google strategy to authenticate users with their Google accounts. This is a preset of the generic OAuth flow with Google’s endpoints pre-configured.
Creating a Google OAuth Client
- Go to the Google Cloud Console
- Select or create a project
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- For Application type, select Web application
- Configure the authorized redirect URI:
- For production:
https://your-domain.com/oauth/provider-callback - For local development:
http://localhost:3000/oauth/provider-callback
- For production:
- Copy the Client ID and Client Secret
Environment Setup
Preset Values
| Setting | Default |
|---|---|
| Accounts URL | https://accounts.google.com |
| Authorization URL | https://accounts.google.com/o/oauth2/v2/auth |
| Token URL | https://oauth2.googleapis.com/token |
| Default scopes | openid email profile |
OAUTH_* values.
Example: Google Sheets + Drive
Available Scopes
| Scope | Description |
|---|---|
https://www.googleapis.com/auth/spreadsheets | Read/write Google Sheets |
https://www.googleapis.com/auth/drive.readonly | Read Google Drive files |
https://www.googleapis.com/auth/drive | Full Google Drive access |
https://www.googleapis.com/auth/gmail.readonly | Read Gmail |
openid | OpenID Connect authentication |
email | Access email address |
profile | Access profile information |
Tool Context
WhenAUTH_STRATEGY=google, successful authentication populates the tool context with:
context.providerToken— the Google access tokencontext.resolvedHeaders—{ Authorization: "Bearer <google-access-token>" }context.provider— provider info object withaccessToken,refreshToken,expiresAt,scopescontext.authStrategy—"google"
Example Tool
Additional Options
Offline Access
To receive a refresh token (for long-lived access), addaccess_type=offline to extra auth params: