IdP contract
Plat5’s gateway accepts signed JWT access tokens from any issuer (OAuth 2.0 JWT access tokens, RFC 9068). An OIDC provider qualifies because it issues signed JWTs; ID tokens and userinfo endpoints are never required.
Gateway requirements
Section titled “Gateway requirements”| Requirement | Gateway env |
|---|---|
Issuer URL (iss) |
AUTH_ISSUER (required) |
| JWKS | AUTH_JWKS_URI (optional; when omitted, discovered via {AUTH_ISSUER}/.well-known/openid-configuration, falling back to /.well-known/oauth-authorization-server) |
Allowed audiences (aud) |
AUTH_ALLOWED_AUDIENCES (required; comma-separated, or * to accept any) |
| Subject claim path | AUTH_SUBJECT_CLAIM (dotted JSON path, default sub) |
| Name claim paths | AUTH_NAME_CLAIMS (comma-separated dotted JSON paths, default name,preferred_username) |
| Scope claim path | AUTH_SCOPE_CLAIM (optional dotted JSON path; space-delimited string or string array intersected with resolved permissions on kind routes) |
Policy claim paths forwarded to admit for per-org required_idp_claims checks are configured in control-plane config via top-level policy_claims (settings), not via gateway env.
Each token is checked for an allowed asymmetric signature algorithm (RS256/384/512, PS256/384/512, ES256/384, EdDSA), iss, aud (unless AUTH_ALLOWED_AUDIENCES=*), exp, nbf (when present, 60 seconds of clock leeway), a kid header matching a key in JWKS, signature validity, and a non-empty subject claim.
Subject claim
Section titled “Subject claim”AUTH_SUBJECT_CLAIM names the claim holding the user’s stable subject at the IdP. The gateway sends (iss, subject) to identity’s admit; a new pair creates the user. Services never see the IdP’s subject — they see a per-tree member id on tree routes, and a user id on user routes.
- Most IdPs (Auth0, Okta, Entra ID, Keycloak, Cognito) put a stable subject in
sub(the default). - Issuers that place the stable id in a nested claim use a dotted path (for example,
https://acme.com/user_idoruser.id). Plat5 Auth and standard OIDC/OAuth2 issuers usesub.
Missing or empty subject claim → 401.
A user’s name
Section titled “A user’s name”A user has one display name across every tree, shown in member lookups and GET /user. It is null until known.
- Seeded on first sign-in: On admit, the gateway reads the claims in
AUTH_NAME_CLAIMSin order and sends identity the first non-empty value (trimmed, truncated to 128 chars). Identity stores it only if the user’s name is currently empty. - Editable in Plat5: Once created, the user can set or clear their name with
PATCH /user { name }(and an operator can withPATCH /users/{user_id} { name }). Clearing it tonulllets a later sign-in with a claim seed it again.
An org admin cannot edit a user’s name, because it applies across every tree. Service accounts have their own names, managed by their tree.
Bring your own IdP
Section titled “Bring your own IdP”- Set
AUTH_ISSUER. Optionally setAUTH_JWKS_URIif your IdP doesn’t expose OIDC / OAuth 2.0 discovery metadata, or if the gateway reaches JWKS over a container-internal URL that differs fromAUTH_ISSUER. - Set
AUTH_ALLOWED_AUDIENCESto your API audience(s), or*. - Set
AUTH_SUBJECT_CLAIMif your IdP’s stable subject isn’tsub, andAUTH_NAME_CLAIMSif your access tokens carry a name under a different claim.
Requests may also authenticate with API keys on the same Authorization: Bearer header. The gateway still requires AUTH_ISSUER and AUTH_ALLOWED_AUDIENCES to boot.