Skip to content

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.

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.

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_id or user.id). Plat5 Auth and standard OIDC/OAuth2 issuers use sub.

Missing or empty subject claim → 401.

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_CLAIMS in 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 with PATCH /users/{user_id} { name }). Clearing it to null lets 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.

  1. Set AUTH_ISSUER. Optionally set AUTH_JWKS_URI if your IdP doesn’t expose OIDC / OAuth 2.0 discovery metadata, or if the gateway reaches JWKS over a container-internal URL that differs from AUTH_ISSUER.
  2. Set AUTH_ALLOWED_AUDIENCES to your API audience(s), or *.
  3. Set AUTH_SUBJECT_CLAIM if your IdP’s stable subject isn’t sub, and AUTH_NAME_CLAIMS if 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.