Skip to content

OAuth2 / OIDC Provider

oauth2 oidc openid connect identity provider idp authorization server third-party sso

Nhost Auth can act as an OAuth2 Authorization Server and OpenID Connect Identity Provider. This lets third-party applications — wikis, dashboards, MCP servers, internal tools — authenticate users through your Nhost project using standard OAuth2/OIDC flows.

sequenceDiagram
participant App as Third-Party App
participant Auth as Nhost Auth
participant Consent as Your Consent Page
App->>Auth: Redirect to /oauth2/authorize
Auth->>Consent: Redirect with request_id
Consent->>Consent: User authenticates & approves
Consent->>Auth: POST /oauth2/login
Auth->>App: Redirect with authorization code
App->>Auth: Exchange code for tokens
Auth->>App: Access token, ID token, refresh token
  • Three client types — confidential (with secret), public (no secret, PKCE required), and URL-based (CIMD)
  • Scopesopenid, profile, email, phone, offline_access, graphql
  • RSA-signed JWT tokens — access tokens and ID tokens signed with RSA (RS256, RS384, or RS512), with a JWKS endpoint for verification
StandardDescription
RFC 6749OAuth 2.0 Authorization Framework — Authorization Code grant
RFC 6750OAuth 2.0 Bearer Token Usage
RFC 7009Token Revocation — Refresh token revocation
RFC 7517JSON Web Key (JWK) — JWKS endpoint for public signing keys
RFC 7519JSON Web Token (JWT) — RSA-signed access and ID tokens
RFC 7636PKCE — Proof Key for Code Exchange (S256 only)
RFC 7662Token Introspection — Check token validity
RFC 8414Authorization Server Metadata — Discovery endpoints
RFC 9207Issuer Identification — iss parameter in authorization responses
RFC 9728Client ID Metadata Document — URL-based client IDs for MCP and similar tools
OpenID Connect Core 1.0ID tokens, UserInfo, Discovery, standard claims
  • An RSA signing key must be configured. Other algorithms are not supported when the OAuth2 provider is enabled.
  • The OAuth2 provider must be explicitly enabled via configuration.

Go to your project’s dashboard, then SettingsOAuth2 Provider.

OAuth2 Provider settings