- Go to Google Cloud Console → APIs & Services → Credentials
- Create an OAuth 2.0 Client ID (Web application)
- Add authorized redirect URI:
https://yourapp.com/auth/oauth/google/callback - Copy the Client ID and Client Secret
Configuration
Section titled “Configuration”from authfort import GoogleProvider
GoogleProvider(
client_id="your-google-client-id",
client_secret="your-google-client-secret",
) from authfort import GoogleProvider
GoogleProvider(
client_id="your-google-client-id",
client_secret="your-google-client-secret",
) Scopes
Section titled “Scopes”Required scopes (openid, email, profile) are always included automatically. Use extra_scopes to request additional Google API access:
GoogleProvider( client_id="...", client_secret="...", extra_scopes=("https://www.googleapis.com/auth/calendar",),)| Required Scope | Description |
|---|---|
openid | Required for OpenID Connect |
email | Access the user’s email address |
profile | Access the user’s name and avatar |
Endpoints
Section titled “Endpoints”| Method | Endpoint | Description |
|---|---|---|
| GET | /auth/oauth/google/authorize | Start Google OAuth flow |
| GET | /auth/oauth/google/callback | Handle Google callback |