Issuer: the value of APP_URL without trailing slash (https://checkin.example.com). Discovery: {issuer}/.well-known/openid-configuration.
Endpoints#
GET /oauth/authorize#
| Parameter | Required | Notes |
|---|---|---|
response_type | yes | code |
client_id | yes | the application's UUID |
redirect_uri | yes* | one of the registered URIs, exact match (*optional when the client has exactly one) |
scope | yes | space-separated: openid profile email |
state | recommended | returned unchanged |
nonce | recommended | returned inside the ID token |
code_challenge, code_challenge_method=S256 | required for public clients, recommended for all | PKCE |
prompt | no | none, login, consent (Passport semantics) |
Errors follow RFC 6749 (error, error_description, state on the redirect URI). A person who may not use the application gets an HTML 403 page with a link carrying error=access_denied.
POST /oauth/token#
Form-encoded. Grants: authorization_code (+ code_verifier), refresh_token, client_credentials. Client authentication: client_secret_post, client_secret_basic, or none for public clients.
{
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "eyJ…",
"refresh_token": "def5…",
"id_token": "eyJ…"
}id_token is present only when the openid scope was granted and a person (not a client credential) is the subject. Rate limit: 120 requests per minute per IP.
GET|POST /oauth/userinfo#
Authorization: Bearer {access_token} with the openid scope. Returns the claims of the scopes granted to the token:
{ "sub": "0c6c…", "name": "Ada Lovelace", "preferred_username": "ada", "updated_at": 1760000000, "amr": ["pwd", "hwk"], "email": "ada@ap.it", "email_verified": true }GET /oauth/jwks#
{ "keys": [ { "kty": "RSA", "use": "sig", "alg": "RS256", "kid": "…", "n": "…", "e": "AQAB" } ] }Cacheable for an hour. The kid is the RFC 7638 thumbprint of the key; it changes only when the key pair changes.
GET|POST /oauth/logout#
RP-initiated logout. Parameters: id_token_hint (preferred; verified with our key, identifies the client), client_id, post_logout_redirect_uri, state. The Checkin session ends; the browser is sent to post_logout_redirect_uri only when its origin matches one of the client's redirect URIs, otherwise to the login page.
ID token#
Header: {"alg":"RS256","typ":"JWT","kid":"…"}. Claims:
| Claim | Value |
|---|---|
iss | issuer |
aud | the client id |
sub | the person's UUID (users.uuid), never reused |
iat, exp | issued at / expiry (1 hour) |
auth_time | when the person signed in to Checkin, for this session |
nonce | echoed from the authorization request |
at_hash | left half of SHA-256 of the access token, base64url |
amr | how the person signed in (RFC 8176): pwd, otp (authenticator app, recovery code, code by email), hwk (passkey or security key), fed (Google, GitHub, Microsoft), and mfa when two factors were used |
acr | urn:checkin:mfa with two factors, urn:checkin:single otherwise |
name, preferred_username, updated_at | with profile |
email, email_verified | with email |
roles | with roles: the person's roles in this application (a list, possibly empty) |
amr and auth_time describe the sign-in that opened the session: an application that needs a second factor checks that amr contains mfa. A refreshed ID token has no amr.
Access token#
Passport's JWT (RS256, same key): aud = client id, sub = the person's internal id, scopes, jti. Applications should treat it as opaque and use it only against /oauth/userinfo.
Scopes#
| Scope | Description shown on the consent screen |
|---|---|
openid | Know who you are (a stable, anonymous identifier) |
profile | Read your name and username |
email | Read your e-mail address |
roles | Know your roles in the application |
Roles#
Administration → Applications → Roles: the application's default roles (for everyone without roles of their own) and the roles of each person, comma separated (admin, billing). With the roles scope they come in the roles claim of the ID token and of UserInfo. In an application open to everyone, only the people with roles of their own are listed. The products of the family read it with their Checkin preset: Role claim roles, then map each value onto one of their roles.
Add scopes in AppServiceProvider::configurePassport() and the matching claims in App\Oidc\Claims.
Verifying an ID token (any language)#
- Fetch the JWKS; pick the key by
kid. - Verify the signature (
RS256only). - Check
issequals the issuer,audcontains your client id (andazpequals it ifaudhas several values),expis in the future (allow a minute of skew),nonceequals the one you sent. - Use
subas the stable identifier; never the e-mail.