Skip to main content

Google

Setting Up the Authorization Provider via Google OAuth 2.0

To integrate Google authorization into your project, you need to create a project in the Google Cloud Console, obtain credentials, and configure the OAuth consent screen. This guide will walk you through the process step by step.

Required information for your form:

  • OAUTH client ID: Your_Client_ID.apps.googleusercontent.com
  • Secret key for OAUTH data verification: Your_Client_Secret
  • URL for OAUTH provider authentication: https://accounts.google.com/o/oauth2/v2/auth
  • URL for OAUTH provider token verification: https://oauth2.googleapis.com/tokeninfo
  • URL for OAUTH Origins header: https://www.googleapis.com

Step 1: Create a Project in Google Cloud Console

  1. Go to Google Cloud Console: https://console.cloud.google.com/.
  2. If you don't have a project yet, create one:
    • Click on the project dropdown in the top panel.
    • Click "New Project".
    • Enter a descriptive name for the project (e.g., My App Auth).
    Messages button
    • If necessary, select an organization and click "Create".

Before creating credentials, you need to set up the screen that users will see when granting access to your application.

  1. In the left menu, select "APIs & Services" -> "OAuth consent screen". Messages button Messages button
  2. Application Information
    • Application Name: Provide the public name of your application that users will see.
    • Support Email: Email for users to contact if they have questions.
    Messages button
  3. Choose the user type ("External" for applications available to any user with a Google account). Messages button
  4. Fill in your contact email: Messages button
  5. Click "Create". Messages button
  6. Click "Save and Continue". The next steps (Scopes, Test Users) can be filled in or skipped and returned to later.

Step 3: Create Credentials (Client ID and Client Secret)

  1. In the left menu, select "APIs & Services" -> "Credentials".

    Messages button
  2. Click "Create Credentials" at the top of the page and select "OAuth Client ID".

    Messages button Messages button
  3. Select Application Type: Web application. Provide a name for the application.

    Messages button
  4. Specify Authorized Redirect URIs:

    • Example: https://your-site.com/
  5. Click "Create".

  6. Congratulations! A modal window will appear with your keys. Save them in a secure place.

    • "Client ID" is your OAUTH client ID.
    • "Client Secret" is your Secret key for OAUTH data verification.

Filling Out the Form in Your Project

Messages button

Now, using the obtained data, fill out the provider creation form in your project:

Field in your formValue for Google OAuthNote
OAUTH client IDxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.comClient ID from step 3.
URL for OAUTH provider authenticationhttps://accounts.google.com/o/oauth2/v2/authStandard endpoint to initiate authorization.
URL for OAUTH provider token verificationhttps://oauth2.googleapis.com/tokeninfoEndpoint to verify the validity of the obtained token.
URL for OAUTH Origins headerhttps://www.googleapis.comIndicates which domain requests are allowed from.
Secret key for OAUTH data verificationGOCSPX-xxxxxxxxxxxxxxxxxxxxxxxxxxClient Secret from step 3.