Google API

The Google emulator provides OAuth 2.0 and OpenID Connect (OIDC) support for local development and testing.

Configuration

google:
  users:
    - email: testuser@gmail.com
      name: Test User
    - email: dev@example.com
      name: Developer
  oauth_clients:
    - client_id: emu_google_client_id
      client_secret: emu_google_client_secret
      name: Code App (Google)
      redirect_uris:
        - http://localhost:3000/api/auth/callback/google

OAuth 2.0 Flow

The emulator implements the standard Google OAuth 2.0 authorization code flow:

  1. Your app redirects the user to the emulator's authorize endpoint
  2. The emulator presents a consent screen (or auto-approves in test mode)
  3. The user is redirected back with an authorization code
  4. Your app exchanges the code for access and refresh tokens
  5. Tokens can be used to access the userinfo endpoint

Endpoints

  • GET /o/oauth2/v2/auth - authorization endpoint
  • POST /oauth2/v4/token - token exchange
  • GET /oauth2/v2/userinfo - get user info
  • GET /.well-known/openid-configuration - OIDC discovery document
  • GET /oauth2/v3/certs - JSON Web Key Set (JWKS)