OpenID Connect reference

The endpoints, the ID token and its claims, scopes and roles, and how to verify a token.

Issuer: the value of APP_URL without trailing slash (https://checkin.example.com). Discovery: {issuer}/.well-known/openid-configuration.

Endpoints#

GET /oauth/authorize#

ParameterRequiredNotes
response_typeyescode
client_idyesthe application's UUID
redirect_uriyes*one of the registered URIs, exact match (*optional when the client has exactly one)
scopeyesspace-separated: openid profile email
staterecommendedreturned unchanged
noncerecommendedreturned inside the ID token
code_challenge, code_challenge_method=S256required for public clients, recommended for allPKCE
promptnonone, 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.

JSON
{
  "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:

JSON
{ "sub": "0c6c…", "name": "Ada Lovelace", "preferred_username": "ada", "updated_at": 1760000000, "amr": ["pwd", "hwk"], "email": "ada@ap.it", "email_verified": true }

GET /oauth/jwks#

JSON
{ "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:

ClaimValue
ississuer
audthe client id
subthe person's UUID (users.uuid), never reused
iat, expissued at / expiry (1 hour)
auth_timewhen the person signed in to Checkin, for this session
nonceechoed from the authorization request
at_hashleft half of SHA-256 of the access token, base64url
amrhow 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
acrurn:checkin:mfa with two factors, urn:checkin:single otherwise
name, preferred_username, updated_atwith profile
email, email_verifiedwith email
roleswith 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#

ScopeDescription shown on the consent screen
openidKnow who you are (a stable, anonymous identifier)
profileRead your name and username
emailRead your e-mail address
rolesKnow 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)#

  1. Fetch the JWKS; pick the key by kid.
  2. Verify the signature (RS256 only).
  3. Check iss equals the issuer, aud contains your client id (and azp equals it if aud has several values), exp is in the future (allow a minute of skew), nonce equals the one you sent.
  4. Use sub as the stable identifier; never the e-mail.