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
- Go to Google Cloud Console: https://console.cloud.google.com/.
- 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).
- If necessary, select an organization and click "Create".
Step 2: Configure the OAuth consent screen
Before creating credentials, you need to set up the screen that users will see when granting access to your application.
- In the left menu, select "APIs & Services" -> "OAuth consent screen".
- 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.
- Choose the user type ("External" for applications available to any user with a Google account).
- Fill in your contact email:
- Click "Create".
- 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)
-
In the left menu, select "APIs & Services" -> "Credentials".
-
Click "Create Credentials" at the top of the page and select "OAuth Client ID".
-
Select application type:
Web application. Provide a name for the application.
-
Specify authorized redirect URIs:
- Example:
https://your-site.com/
- Example:
-
Click "Create".
-
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
Now, using the obtained data, fill out the provider creation form in your project:
| Field in your form | Value for Google OAuth | Note |
|---|---|---|
| OAuth Provider | Google | Select Google from the list of services. |
| OAuth client ID | xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com | Client ID from step 3. |
| URL for OAuth provider authentication | https://accounts.google.com/o/oauth2/v2/auth | Standard endpoint to start authorization. |
| Secret key for OAuth data verification | GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxxxx | Client Secret from step 3. |
| OAuth project ID | Your_Project_ID | Project ID created in step 1. |
| URL for OAuth Origins header | https://www.googleapis.com | Indicates which domain requests are allowed from. |
| Token exchange URL (default — from provider preset) | can be left blank | Optional field. Defaults to https://oauth2.googleapis.com/token. |