How to set up Google Login for Discourse
![How to set up Google Login for Discourse - How to set up Google Login for Discourse How to set up Google Login for Discourse - How to set up Google Login for Discourse](https://appflix.cc/wp-content/uploads/2023/06/How-to-set-up-Google-Login-for-Discourse-1024x544.jpg)
Once the Discourse site installation and hosting are complete, it is advisable to set up the login environment first. Discourse supports various login methods to make it easy for users to register and log in to the community. I prefer using Google accounts or Facebook and Apple accounts to log in rather than directly registering an account on the site.
Many people also prefer using their existing Google or Apple accounts for privacy protection and more convenient login. On this page, I will share how to set up the Google login environment for the Discourse site.
Create a project for a Google API service
![How to set up Google Login for Discourse - Create a project for a Google API service How to set up Google Login for Discourse - Create a project for a Google API service](https://appflix.cc/wp-content/uploads/2023/06/Create-a-project-for-a-Google-API-service-1024x583.webp)
To create a service for logging into a Google account on the Discourse website, access the Google Cloud page by logging in to the Discourse site.
Go to the main page and select the [APIs & Services]
menu.
![How to set up Google Login for Discourse - Create a project for a Google API service 02 How to set up Google Login for Discourse - Create a project for a Google API service 02](https://appflix.cc/wp-content/uploads/2023/06/Create-a-project-for-a-Google-API-service_02-1024x595.webp)
On the [APIs & Services]
page, click [Select a project]
at the top, then click the [NEW PROJECT] button.
![How to set up Google Login for Discourse - Create a project for a Google API service 03 How to set up Google Login for Discourse - Create a project for a Google API service 03](https://appflix.cc/wp-content/uploads/2023/06/Create-a-project-for-a-Google-API-service_03.webp)
Enter an easily identifiable name in the [Project name]
field, and click the [Create]
button.
Create an OAuth consent screen
![How to set up Google Login for Discourse - Create a project for a Google API service 04 How to set up Google Login for Discourse - Create a project for a Google API service 04](https://appflix.cc/wp-content/uploads/2023/06/Create-a-project-for-a-Google-API-service_04-1024x544.webp)
- Select the project you just created.
- From the left sidebar, choose
[OAuth consent screen]
. - Check the User Type as
[External]
. - Click the
[Create]
button.
![How to set up Google Login for Discourse - Create a project for a Google API service 05 How to set up Google Login for Discourse - Create a project for a Google API service 05](https://appflix.cc/wp-content/uploads/2023/06/Create-a-project-for-a-Google-API-service_05-1024x729.webp)
- App name: Please enter the name of the website.
- User support email: Enter an email account where you can receive actual emails.
- Application home page: Enter the homepage address of the website where Google login will be applied.
- Application privacy policy: Enter the address of the webpage that contains the website’s privacy policy.
- Application terms of service: Enter the link to the terms of service of the website.
- Authorized domains: Enter the domain address that has been registered in the Google Search Console.
- Developer contact information: Enter an email address where you can be contacted.
![How to set up Google Login for Discourse - Create a project for a Google API service 06 How to set up Google Login for Discourse - Create a project for a Google API service 06](https://appflix.cc/wp-content/uploads/2023/06/Create-a-project-for-a-Google-API-service_06-1024x602.webp)
- Select the project you just created, then click on [Credentials] in the sidebar menu.
- On the Credentials page, click on the [CREATE CREDENTIALS] link at the top.
- Select OAuth client ID.
![How to set up Google Login for Discourse - Create a project for a Google API service 07 How to set up Google Login for Discourse - Create a project for a Google API service 07](https://appflix.cc/wp-content/uploads/2023/06/Create-a-project-for-a-Google-API-service_07.webp)
- Application type: Set the application type to [Web application].
- Name: Enter the name of the website where the application will be applied.
- Authorized JavaScript origins: Enter the domain address where the API will be used.
- Authorized redirect URIs: Add ‘/auth/google_oauth2/callback’ after the domain address where the API will be used.
For example:https://forum.appflix.cc/auth/google_oauth2/callback
![How to set up Google Login for Discourse - Create a project for a Google API service 08 How to set up Google Login for Discourse - Create a project for a Google API service 08](https://appflix.cc/wp-content/uploads/2023/06/Create-a-project-for-a-Google-API-service_08.webp)
OAuth client creation is complete. The above Client ID and Client secret will be used in the Discourse settings. You can verify them again in the Credentials menu of the project.
Publish your app
![How to set up Google Login for Discourse - Create a project for a Google API service 09 How to set up Google Login for Discourse - Create a project for a Google API service 09](https://appflix.cc/wp-content/uploads/2023/06/Create-a-project-for-a-Google-API-service_09.webp)
The app is currently in the testing state. You need to publish the app for Google account login on Discourse to work properly.
- Select the project, then choose
[OAuth consent screen]
from the sidebar menu. - In the Publishing status section, click
[PUBLISH APP]
.
Enter your Google OAuth Client information in Discourse
![How to set up Google Login for Discourse - Enter your Google OAuth Client information in Discourse 01 How to set up Google Login for Discourse - Enter your Google OAuth Client information in Discourse 01](https://appflix.cc/wp-content/uploads/2023/06/Enter-your-Google-OAuth-Client-information-in-Discourse_01-1024x685.webp)
①. Go to the Admin page.
②. Select the Settings tab.
③. Search for ‘google’ in the settings search bar.
④. Check the [enable google oauth2 logins] setting.
⑤. Enter the issued Client ID.
⑥. Enter the Client secret.
![How to set up Google Login for Discourse - Enter your Google OAuth Client information in Discourse 02 How to set up Google Login for Discourse - Enter your Google OAuth Client information in Discourse 02](https://appflix.cc/wp-content/uploads/2023/06/Enter-your-Google-OAuth-Client-information-in-Discourse_02.webp)
Now, try logging in on the Discourse website. If you see the [Sign in with Google] button, the configuration has been successfully completed.