Here’s how to configure Discourse to allow login and registration with Google OAuth2.
Go to https://console.developers.google.com and create a new Project. Wait a minute as needed for it to appear.
In the new project, in the menu on the left, click “APIs & auth” > Credentials.
Go ahead and click Configure Consent Screen button. Fill as appropriate; we recommend populating all these fields!
https://. In the Authorized Redirect URI section, add the base url with
/auth/google_oauth2/callback. Click the Create Client ID button.
The web application will appear with its client ID and secret.
Under “APIs & auth” > APIs, you’ll see a huge list. Find “Contacts API” and “Google+ API”. Enable both of them.
In your Discourse site settings, check “enable google oauth2 logins”, and fill in your client id and client secret from step 4.
If you’re using SSL and are getting errors when authenticating with Google OAuth2, see this topic.