Tokens: the id_token is an assertion, the access token is a credential
Status
Section titled “Status”Accepted.
Approx. 2026-08 (token-claims-followups.md first committed 2026-08-27 after a coherence pass; the apiAccess mint path was added later).
Context
Section titled “Context”The platform is an OIDC provider for the applications it fronts. A relying party receives an id_token and an access token after login. An access token is a bearer credential. If the platform accepted every access token it issued as authority on its own API, any relying party that received a user’s token could relay it and act as that user, with all of the user’s platform roles, against the platform. That is more power than a login to one application needs.
At the same time, some first-party applications legitimately call the platform API on behalf of the signed-in user.
Decision
Section titled “Decision”The two tokens have different jobs.
- The id_token is an assertion to the application about its own user: what that user holds inside that application’s walls. Its
rolesare narrowed to the roles bound to the OAuth client’s applications, and theapplicationsclaim lists only the applications the client covers. - The access token is a credential, and by default it is authority-free. An interactive login mints a token marked
token_use: identity, which the platform API middleware rejects as an API bearer. - An OAuth client flagged
apiAccessis the explicit per-client grant. For such a client the access token istoken_use: apiand is narrowed to that client’s applications:roles: only those bound to the client’s applications (platform-wide roles drop out);applications: the user’s accessible applications intersected with the client’s, with the all-applications flag forced off on a scoped client;scope: the permissions derived from the narrowed roles, intersected with the requested scope.
- An app-scoped client therefore can never mint authority beyond its own applications, however broad the user’s platform access is.
- Client-credentials tokens for service accounts are a separate path and are authority-bearing by design.
Known gaps are recorded rather than hidden: email_verified is currently emitted as true whenever an email exists (the identity model has no verification state, and omitting the claim is the safer interim), all_applications is deprecated in favour of the "*" sentinel in applications, and portal id_tokens carry an empty tier because a portal identity is not a platform principal.
Consequences
Section titled “Consequences”Good:
- A compromised or malicious relying party cannot use a user’s login token to call the platform API.
- Authority is opt-in, auditable per OAuth client and capped by the client’s application set.
- The id_token tells an application only what it needs about its own user.
Bad:
- First-party apps that call the platform API as the user must be configured with
apiAccess; a missing flag shows up as a 401-style rejection that is easy to misread. - Two token shapes and a
token_useclaim add concepts for integrators. - The
email_verifiedgap means relying parties must not treat the claim as proof of verification.
Alternatives considered
Section titled “Alternatives considered”| Alternative | Why not |
|---|---|
| One token that is both identity and authority | Allows relay by any relying party. |
| Opaque access tokens with introspection | Adds a round trip to every API call; JWT validation with the published key suffices. |
Scope-only gating (no token_use) |
Scopes can be requested broadly; a hard type check on the bearer is simpler to reason about. |