How to get credentials for Google Authentication setup

09 October 2025



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.


Google Cloud Console

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.


Create Project Screen

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.


View All Products

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.


OAuth Consent Screen

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.


Branding Tab

Figure 5


7. Add Authorized Domains

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


Add Authorized Domain

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.


Add Test User

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.


Add Scopes

Figure 8


10. Create a Client

Navigate to the Clients tab and click Create Client.


Create Client

Figure 9


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


Select Web Application

Figure 10


11. Set Redirect URIs

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


Authorized Redirect URIs

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.


Google Client ID and Secret

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! ✅