Google sign-in needs an OAuth client in a Google Cloud project. It is free and takes about ten minutes the first time.
1. Create the OAuth client
-
Open the Google Cloud console credentials page. Create a project if you do not have one.
-
If prompted, configure the OAuth consent screen first: choose External, give the app your site’s name, a support email and your privacy policy URL. Scopes:
emailandprofileare all FluentAuth asks for. -
Click Create credentials → OAuth client ID.
-
Application type: Web application.
-
Under Authorized redirect URIs, add your login page:
https://example.com/wp-login.phpUse
httpsand the exact host your site uses (with or withoutwww), or Google will refuse the callback. -
Click Create and copy the Client ID and Client secret.
2. Connect it to FluentAuth
Either paste the two values under FluentAuth → Settings → Social Login → Google, or add
them to wp-config.php:
define('FLUENT_AUTH_GOOGLE_CLIENT_ID', '1234567890-abc.apps.googleusercontent.com');
define('FLUENT_AUTH_GOOGLE_CLIENT_SECRET', 'GOCSPX-…');
Turn on Enable login with Google and save.
3. Test it
Open your login page in a private window. A Continue with Google button should be there. Sign in with a Google account whose email matches an existing user, or, if registration is open, with any account to create one.
Publishing the consent screen
While the consent screen is in Testing, only the Google accounts you list as test users can
sign in, and Google shows a warning. Click Publish app on the consent screen page to open it
to everyone. For the email and profile scopes Google does not require a review.
Common errors
| Google says | Cause |
|---|---|
redirect_uri_mismatch | The redirect URI in the console does not exactly match the login URL, usually http vs https or www |
access_blocked: This app's request is invalid | Consent screen not configured, or still in testing and the account is not a test user |
invalid_client | Client ID or secret pasted with a stray space, or the wp-config constant is misspelled |
To make that button a one-click, personalised one, see Google One-Tap.