AM
BACK TO BLOG
FINDINGSgoogleOauthgcp

Google OAuth Service

2 MIN READ

Master OAuth 2.0 authentication with Google Cloud Platform - A comprehensive guide to integrating GCP OAuth services into your applications with secure credential management and consent flows

Google OAuth Service Configuration on external app

google-oauth

To use the OAuth service of Google in our app, we need to create a project in our gcp console and create a API service in it.

  1. Go to GCP Console and login with your google account. Create a project to get started.

  2. Select the created project and click on "API and Services"
    project-selected

  3. Create a OAuth Consent screen for external access
    oauth-consent-screen

  • Select User Type as "External" and click on Create.
  1. Add the webapp details where you will add this Oauth service
    app-registration
  • Add your App name
  • User support email will be the mail which you use to create the project.
  • Adding logo for the app is optional
  1. Add the authorized domain that is going to use this service. The subsequent sub-domain can use it afterwards.
    auth-domain
  • Also add a developer contact email (can be any)
  1. Now create a OAuth client ID in Credentials
    oauth-client-id

  2. Add all the details about the domain that is going to use service along with callback url
    oauth-client-details

  • Select Application Type as "Web App"
  • Add the Name of App (This will appear to users when trying to authenticate with google)
  • Add the domain or sub-domain in the Authorized Javascript Origin
  • The redirect URL formats goes as {{url}}/api/auth/callback/google
  • Finally click create to get the client ID and secret to add our app and use the service.

This post can be very helpful while creating OAuth for in-house authentication.

Share this post on:

Never Miss
A Post

Get notified when new technical articles drop. From authentication to state management, I share real-world insights.