Here’s how to configure Discourse to allow login and registration with Google OAuth2.
Go to https://console.developers.google.com, on the top left click on Select a project
On the top right, click on New Project
Fill in the project fields. You can also edit the Project ID (optional), then click on Create
(This can take a while, so wait a minute as needed for it to appear.)
3a. It is possible that errors are displayed after creating the project. Ignore them and refresh the page with Ctrl+F5
Select your project clicking on the project name
Open the dropdown menu clicking on Create credentials and choose OAuth client ID .
Configure your OAuth Consent Screen.
6a.Fill as appropriate; we recommend populating all these fields, then click Save.
In the example below we use
https://demo-site.com, be sure to use the URL of your Discourse site including
Choose “Web application” as the Application Type.
In the Authorized Redirect URI section, add the base url with
/auth/google_oauth2/callback. Click the Create button.
The OAuth client dialog will appear with client ID and secret.
In your Discourse site settings, check “enable google oauth2 logins”, and fill in your
google oauth2 client idand
google auth2 client secretprovided earlier.
That’s it, Google login should now work on your Discourse! Go ahead and test it out with any Google account.