Google OAuth2 Provider
The Google OAuth2 provider enables authentication with Google accounts using Google’s standard OAuth2 endpoints. Use this provider when you want Google sign-in without manually configuring auth_url and token_url.
Capabilities
- Authentication: Google account OAuth2 authentication
- Google User Info: Fetches profile information from Google’s OAuth2 userinfo API
- Built-In Endpoints: Uses Google’s OAuth2 authorization and token endpoints automatically
- Scope Management: Configurable OAuth2 scopes with provider defaults
Prerequisites
- Create an OAuth 2.0 client in Google Cloud for a web application.
- Register the redirect URI that your agent uses for Google sign-in.
- Copy the generated client ID and client secret into the provider config.
Configuration Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
client_id | string | Yes | - | Google OAuth2 client ID |
client_secret | string | Yes | - | Google OAuth2 client secret |
scopes | array | No | ["email", "profile"] | Scopes to request during authorization |
Behavior Notes
- The provider uses Google’s built-in OAuth2 endpoints; you do not need to set
auth_urlortoken_url. - If
scopesis omitted, the provider defaults toemailandprofile. - This provider does not currently expose a
hosted_domainor domain restriction setting in its config schema.
Example Configuration
version: "1.0"
providers:
google-oauth:
name: Google OAuth2
description: Google account authentication
provider: oauth2.google
enabled: true
config:
client_id: YOUR_GOOGLE_CLIENT_ID.apps.googleusercontent.com
client_secret: YOUR_GOOGLE_CLIENT_SECRET
scopes:
- openid
- profile
- email
Getting Google OAuth2 Credentials
- Go to Google Cloud Console
- Create or select a project
- Configure the OAuth consent screen
- Go to Credentials and create an OAuth 2.0 Client ID for a web application
- Add your agent’s authorized redirect URI
- Copy the client ID and client secret into the provider configuration
For detailed setup instructions, refer to the Google OAuth2 documentation.