Oauth2 Configuration
This guide explains how to configure the Google OAuth2 connector in your service using the configuration interface.
Steps to Configure
-
Navigate to the Google OAuth2 Connector Settings section in the application.
-
Click on the New button to create a new configuration.
-
Fill out the form fields in the New Google OAuth Settings modal:
- Enter a unique OAuth Name to identify this configuration.
- Input the Client ID provided by Google.
- Provide the Client Secret corresponding to your Google application.
- Specify the Scope required for your application’s permissions (e.g.,
https://www.googleapis.com/auth/gmail.readonly). - Set the Active toggle to Yes to enable the configuration, or No to keep it inactive.
-
Once all required fields are filled, click Generate Token to initiate the OAuth flow and obtain the required token for the configuration.
-
Click Save to store the configuration in the system.
Example Configurations
Here’s an example configuration for the Google OAuth2 connector:
- OAuth Name:
Gmail rico@stoic.money - Client ID:
27073862846-ekndi0v4f1sttph0vvrkvaevtsbhc8tp.apps.googleusercontent.com - Client Secret:
GOCSPX-XXXXXXXXXXXXXXXXX - Scope:
https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/gmail.compose https://www.googleapis.com/auth/gmail.labels - Active:
Yes
- OAuth Name:
Gmail rico@stoic.money - Client ID:
27073862846-2q8hb62d9bjtr4fp7cnmfr80fulurn5h.apps.googleusercontent.com - Client Secret:
GOCSPX-XXXXXXXXXXXXXXXXX - Scope:
https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/gmail.compose https://www.googleapis.com/auth/gmail.labels - Active:
Yes
Configuration Fields
Below is a description of each field in the configuration form:
OAuth Name
- Purpose: A user-friendly name for the configuration.
- Example:
Gmail team@stoic.moneyorDrive API.
Client ID
- Purpose: Identifies your app in Google’s OAuth2 system.
- Where to get it: Found in the Google Cloud Console.
Client Secret
- Purpose: A secret key to authenticate your app with Google’s servers.
- Important: Keep the client secret secure and never expose it publicly.
- Where to get it: Also available in the Google Cloud Console.
Scope
- Purpose: Defines the level of access requested by your application.
- Example:
https://www.googleapis.com/auth/gmail.readonlyfor Gmail readonly access,https://www.googleapis.com/auth/gmail.composefor Gmail draft access,https://www.googleapis.com/auth/gmail.labelsfor Gamail label access. - Note: The scope must align with the permissions enabled in your Google Cloud project.
Active
- Purpose: Toggles whether this OAuth configuration is active.
- Options:
YesorNo.
Notes and Troubleshooting
- Google Cloud Setup: Ensure that your Google Cloud project is properly configured, and OAuth consent screen is set up.
- Generate Token: Make sure you click Generate Token after entering valid Client ID and Client Secret to complete the OAuth flow.
- Scope Validation: Double-check the scope entered matches your application’s API requirements.
- Revoking Tokens: Use the Revoke Access button to invalidate existing tokens if needed.
If issues persist:
- Verify the Client ID and Client Secret are correct.
- Ensure the scope provided is enabled in the Google Cloud Console.
- Check for any errors during the token generation step.