
This guide walks you through the steps to set up Google Authentication and retrieve your Google Client ID and Client Secret for integrating login functionality into your web application.
1. Go to Google Cloud Console
Visit the Google Cloud Console and log in with your Google account.

Figure 1
2. Create a New Project
Click on the Select Project button and then click on Create Project. A new screen will appear as shown below.

Figure 2
3. Select the Project
After creating the project, select it from the same Select Project button at the top.
4. Access Google Auth Platform
Scroll down the dashboard and click on View All Products as shown below.

Figure 3
Click the Google Auth Platform link and then click the Get Started button.
5. Configure OAuth Consent Screen
A form will appear like the one below. Fill in your app details and under the Audience tab, select External.

Figure 4
6. Set Up Branding
Go to the Branding tab and add the homepage URL of your website where users will be redirected after login.

Figure 5
7. Add Authorized Domains
Scroll down to the Authorized domains section, click + Add Domain, and enter your domain. Then click Save.

Figure 6
8. Add Test Users
Navigate to the Audience tab and scroll down. Click on + Add Test User, enter your email address, and click Save.

Figure 7
9. Configure Data Access
Go to the Data Access tab and click on Add or Remove Scopes. Select the recommended options shown below.

Figure 8
10. Create a Client
Navigate to the Clients tab and click Create Client.

Figure 9
On the next screen, choose Web Application or another appropriate option.

Figure 10
11. Set Redirect URIs
Fill in the Authorized JavaScript Origins and
Authorized Redirect URIs (e.g.,
http://localhost:PORT_NUMBER
).

Figure 11
12. Retrieve Your Credentials
Click Create. You will now see your Google Client ID and Google Client Secret as shown below. Copy these values and store them securely.

Figure 12
13. Store in .env File
Add the credentials to your project’s .env
file:
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
YOU'RE DONE! ✅