Skip to content

Security Model

This document defines the public security policy that clients and resource servers must follow.

PKCE S256 Is Mandatory

PKCE S256 is mandatory for every client, including confidential clients. Requests without code_challenge and code_challenge_method=S256 are rejected.

Plain PKCE, manual OAuth without a verifier, and libraries that cannot generate S256 are incompatible.

Token Lifetimes

ArtifactLifetimeNotes
Authorization code120 secondsOne-time use.
Authentication request900 secondsServer-side login state.
Access token15 minutesES256 JWT, aud=sso-resource-api.
ID token15 minutesES256 JWT, aud=client_id.
Refresh token30 daysRotated on every use.
Refresh token family90 daysReplay revokes the family.

Refresh Rotation

Store refresh tokens only on a server or in security-reviewed storage. Replace them atomically after refresh, serialize concurrent refresh attempts, and require a new login after invalid_grant.

Rate Limits

AreaLimit
Authorization20/min/IP
Token, revocation, introspection30/min/IP
UserInfo60/min/IP
Discovery and JWKS60/min/IP

Honor Retry-After and avoid parallel requests using the same refresh token.

Signing and JWKS

Tokens use ES256 on P-256. Discover and cache JWKS, re-fetch on an unknown kid, reject alg=none, and validate issuer, audience, time claims, and token use.

Client Checklist

  • Use HTTPS for production redirect URIs.
  • Generate and validate random state and nonce.
  • Never log codes, tokens, refresh tokens, client secrets, or ID tokens.
  • Confidential clients keep secrets and refresh tokens on the server.
  • Public clients have no secret and rely on PKCE plus redirect URI policy.
  • Use discovery for endpoint metadata.
  • Preserve error_ref and request_id for support.

Released under the MIT License.