Sign in with OpenID Connect
A product signs people in with the authorization code flow. The owner first registers the product in whitegate: its id becomes the client_id, and the owner supplies the exact redirect URIs and issues a client secret.
The issuer is https://whitegate.exocriador.dev. Discovery is at /.well-known/openid-configuration.
Endpoints#
| Purpose | Address |
|---|---|
| Authorization | https://whitegate.exocriador.dev/oidc/authorize |
| Token | https://whitegate.exocriador.dev/oidc/token |
| Userinfo | https://whitegate.exocriador.dev/oidc/userinfo |
| Signing keys | https://whitegate.exocriador.dev/oidc/jwks |
Supported: response type code, grants authorization_code and refresh_token, PKCE method S256, ID tokens signed with EdDSA, client authentication client_secret_basic or client_secret_post. Scopes: openid, email, profile, offline_access.
The flow#
- Send the browser to
/oidc/authorizewithresponse_type=code,client_id,redirect_uri,scope(includingopenid),state,nonce,code_challengeandcode_challenge_method=S256. - whitegate signs the person in if needed and checks the product's door. A person who is refused sees a reason page instead of returning to you.
- The browser comes back to your
redirect_uriwithcode,stateandiss. A code lives 60 seconds and works once. - Your server posts to
/oidc/tokenwithgrant_type=authorization_code,code,redirect_uriandcode_verifier, authenticating with the client secret. - The response carries
access_token,id_token,expires_in(600 seconds) and, whenoffline_accesswas requested, arefresh_token.
An unknown client or an unregistered redirect_uri is never redirected to. A product can be set to require PKCE and a nonce; such a client is refused without them. New products require them by default.
Claims#
The ID token is audience-bound to your client and carries:
| Claim | Meaning |
|---|---|
sub | The person's stable id |
email, email_verified | The address and whether it is confirmed |
name | The display name, or the part of the address before the @ |
level | admin or member in your product |
nonce | Echoed when you sent one |
/oidc/userinfo accepts the access token as Authorization: Bearer and returns sub, email, email_verified and name. It answers 401 once the person no longer has access.
Verify ID tokens against the keys in /oidc/jwks; cache them for about ten minutes and re-read when you meet an unknown kid.
Refresh tokens#
A refresh token lives 30 days and is single use: each refresh returns a new one. Presenting a used token revokes the person's refresh tokens for your product. A refresh fails when the person has lost access.
Back-channel logout#
When a person is refused, blocked, loses a role or has sessions revoked, whitegate posts a logout token to https://<your origin>/api/account/exo/logout, where the origin is the one registered for the product. The token is a JWT of type logout+jwt with sub, iss, aud and the back-channel logout event. End that person's sessions and answer 2xx. Delivery is retried for up to 24 hours.
Errors#
The token endpoint answers invalid_client (401), invalid_grant and unsupported_grant_type. The authorization endpoint reports invalid_request, invalid_scope and unsupported_response_type on the redirect.