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 data for your form:

  • OAuth Provider: Google
  • 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
  • OAuth project ID: Project ID from step 1
  • URL for OAuth Origins header: https://www.googleapis.com
  • Token exchange URL (default — from provider preset) — optional field, defaults to https://oauth2.googleapis.com/token

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 meaningful project name (e.g., My App Auth).
    Google Cloud 'New Project' page with the 'Project name' and 'Location' fields and the 'Create' 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". Google Cloud menu: under 'APIs & Services', the 'OAuth consent screen' item is shown. 'OAuth Overview' page in Google Auth Platform: not configured yet, with the 'Get started' button.
  2. Application information
    • Application name: Provide the public name of your application that users will see.
    • Support email: Email for users to contact in case of questions.
    'App Information' step: the 'App name' field is filled in, followed by the 'User support email' field and the 'Next' button.
  3. Choose the user type ("External" for applications available to any user with a Google account). 'Audience' step: the 'External' user type is selected, with the 'Next' button below.
  4. Fill in your contact email: 'Contact Information' step with the 'Email addresses' field and the 'Next' button.
  5. Click "Create". 'Finish' step: agreement to the 'Google API Services: User Data Policy' is checked, with the 'Continue' and 'Create' buttons.
  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".

    Google Cloud menu: under 'APIs & Services', the 'Credentials' item is shown.
  2. Click "Create Credentials" at the top of the page and select "OAuth Client ID".

    'Credentials' page in 'APIs & Services' with the 'Create credentials' button at the top and empty key tables. The 'Create credentials' menu is open with the 'OAuth client ID' option highlighted.
  3. Select application type: Web application. Provide a name for the application.

    'Create OAuth client ID' page: 'Web application' is highlighted in the 'Application type' list.
  4. Specify authorized redirect URIs:

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

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

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

Filling out the form in your project​

Provider 'Additional settings' in OneEntry: fields for the JWT key, token lifetimes, 'OAuth client ID', 'OAuth project ID' and OAuth URLs.

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

Field in your formValue for Google OAuthNote
OAuth ProviderGoogleSelect Google from the list of services.
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 start authorization.
Secret key for OAuth data verificationGOCSPX-xxxxxxxxxxxxxxxxxxxxxxxxxxClient Secret from step 3.
OAuth project IDYour_Project_IDProject ID created in step 1.
URL for OAuth Origins headerhttps://www.googleapis.comIndicates which domain requests are allowed from.
Token exchange URL (default — from provider preset)can be left blankOptional field. Defaults to https://oauth2.googleapis.com/token.