We have recently launched Crunchify forum at https://ask.crunchify.com
powered by Discourse.org.
Immediately after setup, the first thing I wanted to do is to provide Google Single sign on
option with OAuth2
. I’ve just completed all detailed steps and would like to share with all my readers. If you have below two questions then you are at right place 🙂
- Configuring Google login for Discourse
- Login to Discourse with custom Oauth2 provider
Let’s get started:
Step-1
- Go to Google Cloud Console: https://console.cloud.google.com/projectselector2/home/dashboard
- Create
Project
- Provide
Project Name
andProject ID
Step-2
- Click on Home
- Click on Go to API Overview link
Next page will open.
- Click on
Credentials
- Click on
Create Credentials
- Click on
OAuth Client ID
Step-3
- Click on
Configure Consent Screen
(for 1st time user) - User type:
External
Fill out form
and provide all detailed information.
Step-4
- Click on
Web application
- Provide Origin URI:
https://ask.crunchify.com
- Provide Redirect URI: https://ask.crunchify.com/auth/google_oauth2/callback
- Click on
Create
On next screen, you will see you application’s Client ID
and Client Secret
Step-5
- Now go to
APIs & Services
again - Search for Google+ and Contacts in search bar on next screen.
- Enable
Google+ API
andContacts API
in Google Cloud Console
- Enable
Now you are all set at Google Cloud side. Next step is to add Google Oauth2 Client ID
and Secret
to Discourse Forum.
Step-6
- Go to Discourse Forum
- Under
Admin
->Settings
->Login
Page - Enable
Google Oauth2
authentication - Provide
Client ID
andClient Secret
Save
all options
Step-7
- Now click on your forums’
Sign Up button
and you should see nice blue optionCreate new Account with Google
as you see at the top of this post. - Once you provide
Gmail UserID
andPassword
, click onAllow button
and you will be able to login to forum.
All above steps works with your forum if there is no HTTPS enabled. For HTTPS, some users have posted some problems which I will debug in few days and update.