Google oAuth2
Here you can read how to set up Google Services
Setup
To create an OAuth 2.0 client ID in the Google Cloud Platform Console:
Go to the Google Cloud Platform Console.
From the projects list, select a project or create a new one.
Navigate to API & Services > Credentials.
Configure your OAuth consent screen:
Set up the app name, support email, and your app’s domain, if applicable.
Create OAuth Credentials:
Click New Credentials and select OAuth client ID.
Choose Web application as the application type.
Add your application’s Authorized Redirect URIs (e.g.,
https://yourapp.com/auth/callback
for production, orhttp://localhost:3000/auth/callback
for local development).
After creation, you’ll receive a Client ID and Client Secret. Copy these for use in both your front-end and backend configurations.
To delete a client ID, go to the Credentials page, check the box next to the ID, and click Delete.
Configure API Passport Strategy:
Use the received Client ID and Client Secret.
Follow the OAuth Providers documentation for additional implementation details.
Publishing Your Application
Publishing your application will allow you to authenticate any Google user, enabling the use of your credentials in a production environment.
Set Up OAuth Consent Screen for Production:
In the OAuth consent screen settings, add production details such as the official app name, support email, and privacy policy URL.
Testing the Production Environment:
After deployment, thoroughly test your OAuth setup on the live site to ensure all flows (login, redirect, logout) work smoothly and securely.
Verify tokens are handled correctly and that your OAuth implementation behaves as expected.
Monitor OAuth Usage:
In the Google Cloud Console, go to API & Services > Credentials to monitor usage, track traffic, and troubleshoot any potential issues.
Communicate OAuth Status to Users:
On the login screen, inform users that they can securely log in with Google, and provide a link to your privacy policy to establish user trust.
Verification Note
Currently, no verification is required for basic scopes (e.g., email
and profile
). However, requesting additional scopes in the future, particularly for sensitive or restricted data, may prompt Google to require app verification. This process involves submitting your app for review to ensure it complies with Google’s data policies.
Last updated