OAuth2 & OIDC Providers
Microbase supports Google, Discord, and Custom OIDC providers.
Config-First Credentials (microbase.conf)
Section titled “Config-First Credentials (microbase.conf)”Keep client secrets out of PostgreSQL by setting them in microbase.conf:
OAUTH_GOOGLE_CLIENT_ID=your-google-client-idOAUTH_GOOGLE_CLIENT_SECRET=your-google-client-secretOAUTH_DISCORD_CLIENT_ID=your-discord-client-idOAUTH_DISCORD_CLIENT_SECRET=your-discord-client-secretOAUTH_OIDC_CLIENT_ID=your-oidc-client-idOAUTH_OIDC_CLIENT_SECRET=your-oidc-client-secretOAUTH_OIDC_ISSUER_URL=https://idp.example.comOAuth2 Flow
Section titled “OAuth2 Flow”- Fetch enabled providers via
GET /api/collections/users/auth-methods. - Redirect the user to the provider’s authorization URL with state & PKCE verifier.
- 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.