Skip to content

OAuth2 & OIDC Providers

Microbase supports Google, Discord, and Custom OIDC providers.

Keep client secrets out of PostgreSQL by setting them in microbase.conf:

OAUTH_GOOGLE_CLIENT_ID=your-google-client-id
OAUTH_GOOGLE_CLIENT_SECRET=your-google-client-secret
OAUTH_DISCORD_CLIENT_ID=your-discord-client-id
OAUTH_DISCORD_CLIENT_SECRET=your-discord-client-secret
OAUTH_OIDC_CLIENT_ID=your-oidc-client-id
OAUTH_OIDC_CLIENT_SECRET=your-oidc-client-secret
OAUTH_OIDC_ISSUER_URL=https://idp.example.com
  1. Fetch enabled providers via GET /api/collections/users/auth-methods.
  2. Redirect the user to the provider’s authorization URL with state & PKCE verifier.
  3. Exchange the authorization code via POST /api/collections/users/auth-with-oauth2.

Security: Redirect URIs are validated against configured allowlists, state tokens are single-use, and unverified provider emails are never auto-linked to existing accounts.