Skip to content

Google

  1. Go to Google Cloud Console → APIs & Services → Credentials
  2. Create an OAuth 2.0 Client ID (Web application)
  3. Add authorized redirect URI: https://yourapp.com/auth/oauth/google/callback
  4. Copy the Client ID and Client Secret
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",
)

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 ScopeDescription
openidRequired for OpenID Connect
emailAccess the user’s email address
profileAccess the user’s name and avatar
MethodEndpointDescription
GET/auth/oauth/google/authorizeStart Google OAuth flow
GET/auth/oauth/google/callbackHandle Google callback