
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 NameandProject 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 formand 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 & Servicesagain - Search for Google+ and Contacts in search bar on next screen.
- Enable
Google+ APIandContacts APIin 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->LoginPage - Enable
Google Oauth2authentication - Provide
Client IDandClient Secret Saveall options

Step-7
- Now click on your forums’
Sign Up buttonand you should see nice blue optionCreate new Account with Googleas you see at the top of this post. - Once you provide
Gmail UserIDandPassword, click onAllow buttonand 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.

