Here’s how to configure Discourse to allow login and registration with Google OAuth2.

  1. Go to and create a new Project. Wait a minute as needed for it to appear.

  2. In the new project, in the menu on the left, click “APIs & auth” > Credentials.

  3. Go ahead and click Configure Consent Screen button. Fill as appropriate; we recommend populating all these fields!

  4. Choose “Web application” as the Application Type. In the Authorized JavaScript Origins section, add your site’s base url, including http:// or https://. In the Authorized Redirect URI section, add the base url with /auth/google_oauth2/callback. Click the Create Client ID button.

  5. The web application will appear with its client ID and secret.

  6. Under “APIs & auth” > APIs, you’ll see a huge list. Find “Contacts API” and “Google+ API”. Enable both of them.

  7. 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.