RFC 9068 — JWT Profile for OAuth 2.0 Access Tokens
Implemented
Source: docs/oauth/RFC_9068.md
RFC 9068 — JWT Profile for OAuth 2.0 Access Tokens ¶
Status: Standards Track
Published: 2021-10
L-tier / T-tier: L1 · T5 (issue) + T7 (verify)
OneAuth coverage: Partial (claims and verify-side token-kind checks implemented;typ:at+jwton issue is #328)
See also:RFC_7519.md·RFC_7662.md·LANDSCAPE.md
In one sentence ¶
RFC 9068 is the standard for “what does a JWT-shaped OAuth access token
look like” — it fixes the de-facto JWT shape into a normative profile with
a required claim set and a distinct typ header value (at+jwt).
What problem does it solve? ¶
| Without 9068 | With 9068 |
|---|---|
Every IdP ships JWT access tokens with vendor-specific claim shapes (scp vs scope, cid vs client_id, etc.) |
One canonical claim set; cross-vendor RS tooling becomes possible |
| RSes can’t distinguish “this JWT is an OAuth access token” from “this JWT is an id_token or something else” | The typ:at+jwt header makes the token’s purpose self-describing |
| Multi-IdP RSes have to special-case each issuer’s claim names | One verify path covers any 9068-conformant token |
| Audience handling is inconsistent | Mandatory aud matched against the RS’s identifier |
9068 is the bridge between “JWT is the format” (RFC 7519, generic claims)
and “and here’s how it fits OAuth 2.0 access tokens specifically.” Before
9068, every IdP’s JWT AT had a different shape. After 9068, there’s a
recognized profile.
Relatable example ¶
A modern Auth0 / Okta / Microsoft access token has these claims (roughly):
{
"iss": "https://my-tenant.us.auth0.com/",
"sub": "auth0|65abcd1234",
"aud": ["https://api.example.com", "https://other-api.example.com"],
"iat": 1717000000,
"exp": 1717003600,
"azp": "32555350559",
"scope": "read:orders write:orders",
"client_id": "32555350559",
"jti": "abcd-1234"
}
The typ:at+jwt in the header (when the IdP sets it) is what tells your RS
“this is an access token, not an id_token.” Before 9068, you’d guess from
field presence — fragile and slow.
Key concepts ¶
- The
typ:at+jwtheader is the distinguishing mark. The original
spec had onlytyp:JWT. 9068 introducesat+jwt(plus
application/at+jwtmedia type) so verifiers can reject id_tokens
masquerading as access tokens. - Required claims:
iss,exp,aud,sub,client_id,iat,
jti. Notejtiis REQUIRED in 9068 — not optional as in 7519. This
enables revocation lists out of the box. - Authentication info claims:
auth_time,acr,amrmay appear,
carrying the how of the original authentication (helpful for
step-up flows). scopeis the standardized scope name. Some pre-9068 vendors used
scporscopes; 9068 settles onscope(space-separated string,
per RFC 6749 conventions).- 9068 doesn’t say “you MUST issue JWT access tokens” — it says
“if you issue JWT access tokens, here’s the shape.” Opaque tokens +
introspection (RFC 7662) is still an option.
Wire example ¶
A 9068-conformant access token:
HEADER : {"typ":"at+jwt","alg":"RS256","kid":"key-2025-jun"}
PAYLOAD : {
"iss": "https://as.example.com",
"exp": 1750000000,
"aud": ["https://api.example.com"],
"sub": "user-42",
"client_id": "client-abc",
"iat": 1749996400,
"jti": "fad97d2c-...",
"scope": "read write",
// Optional 9068-blessed claims
"auth_time": 1749996000,
"acr": "urn:ietf:params:acr:phr",
"amr": ["pwd", "mfa"]
}
Verifier flow (per 9068 §4):
- Decode header. If
typisat+jwt(orapplication/at+jwt), proceed
as access token. IftypisJWT, accept (legacy) but log. Iftyp
is something else, reject. - Validate JWS signature against JWKS using
kid. - Check
issmatches expected issuer. - Check
audincludes this RS’s identifier. - Check
expis in the future. - (Optional) Check
jtiagainst revocation list. - Authorize based on
scope+ (if RAR)authorization_details.
Where it lands on the OAuth abstraction ¶
- L1 token format. 9068 is JWT (7519) + OAuth access-token specifics.
- T5 (issue) + T7 (verify). AS mints in 9068 shape; RS validates.
- 9068 is one half of the L1 decision tree at T7:
- JWT-shaped (9068) → local verify
- Opaque → introspect (7662)
OAuth 2.0 status ¶
Published 2021 — years after 2.0. Not part of 6749. Not mandatory for 2.0
conformance. But: nearly every modern 2.0 deployment that ships JWT access
tokens uses (or could use) the 9068 shape because:
- Cross-vendor tooling expects it
- The
typ:at+jwtheader eliminates a class of token-confusion bugs - Standard claim names mean libraries Just Work without per-vendor configs
If you’re issuing JWT access tokens against bare 2.0 today, follow 9068.
Backward compatibility cost is tiny (you’re adding a typ header that old
consumers ignore).
OAuth 2.1 status ¶
Not mandated by 2.1 either. Same status as 2.0: “follow this if you ship
JWT access tokens; opaque tokens + introspection (7662) remain a valid
alternative.”
OAuth 2.1’s stance on access-token format is deliberately neutral. The
spec wants to leave room for sender-constrained tokens (DPoP, mTLS) and
introspection-based deployments equally.
Migration path (pre-9068 JWT → 9068-conformant) ¶
If your AS already issues JWT access tokens but predates 9068:
- Add the
typ:at+jwtheader to new tokens. Old verifiers that ignore
typcontinue to work; new verifiers can distinguish. - Ensure required claims are present:
iss,exp,aud,sub,
client_id,iat,jti. The newcomer is usuallyjti— wire it
to a UUID or other unique generator. - Migrate vendor-specific claim names to the standard ones (
scp→
scope,cid→client_id, etc.). Either:- Soft migration: emit both old and new names for a window; deprecate
old later - Hard migration: cut over once all RSes can parse the new names
- Soft migration: emit both old and new names for a window; deprecate
- Audit
aud: 9068 makesaudrequired and expects the RS to verify
itself in the list. Some pre-9068 ASes shipped tokens withoutaudor
with a placeholder; fix. - Validate the
typat the RS side — reject id_tokens (typ=JWT with
id-specific claims) presented to access-token endpoints.
This is mostly additive — most pre-9068 implementations only need the
typ header and jti to become 9068-conformant.
When NOT to use it ¶
If you’ve made a deliberate choice for opaque tokens (centralized revocation,
no in-line credential exposure to clients, regulatory requirements), 9068
doesn’t apply — you’re on the RFC 7662 introspection path instead.
Otherwise: if you ship JWT access tokens, ship them per 9068. The cost is
zero and the cross-vendor compatibility win is large.
OneAuth status ¶
| 9068 surface | Status | Where (grep-verified) | Notes |
|---|---|---|---|
Standard claims (iss, sub, aud, exp, iat, jti) |
Implemented | TestASMetadata_ClaimsSupported in apiauth/as_metadata_test.go declares the supported set; all handlers emit |
Test asserts claims_supported=[sub,iss,aud,exp,iat,jti] |
client_id claim |
Implemented | Present in token issuance across grant handlers | Standard JWT claim per 9068 §2.2 |
scope claim |
Partial | apiauth/token_validator.go (jwtIssuer.CreateAccessToken) and apiauth/id_jag.go (jwtIDJAGIssuer.CreateIDJAG) |
Access tokens carry the granted scopes as a scopes JSON array, not the space-separated scope string 9068 §2.2.3 names. ID-JAGs carry scope as a string. CustomClaimsFunc can’t add a scope claim (0.1.45) |
jti for revocation support |
Partial | Issued; revocation via core.TokenBlacklist (consumed in apiauth/token_validator.go) + RevocationHandler |
Refresh-token family revoke covers correlated access tokens |
typ:at+jwt header |
Gap | jwtIssuer.CreateAccessToken leaves golang-jwt v5’s default typ:JWT |
Emitting typ:at+jwt on access-token mints is #328 |
authorization_details (RFC 9396) carried |
Implemented | core/authorization_details.go; emitted in apiauth/token_validator.go (jwtIssuer.CreateAccessToken) and apiauth/id_jag.go (jwtIDJAGIssuer.CreateIDJAG) |
Goes alongside scopes |
RS-side typ validation |
Partial, by design | checkAccessTokenKind in apiauth/jwt_helpers.go |
The validator accepts typ at+jwt, application/at+jwt, JWT or none, and refuses other token kinds signed with the same key: logout tokens and ID-JAGs by typ header and sessions by type claim (0.1.45), and Keycloak ID tokens by a typ claim other than Bearer or DPoP (0.1.46). Requiring at+jwt is not planned, because Keycloak’s access tokens carry typ:JWT (issue 329 was closed for that reason) |
auth_time, acr, amr (optional) |
Not implemented | — | OIDC-track work; not needed for bare 9068 |
The verify side already refuses the other token kinds oneauth and Keycloak
sign with the same key. The issue side still mints typ:JWT and a scopes
array; typ:at+jwt is tracked in #328.
Related RFCs ¶
- RFC 7519 JWT — the parent spec 9068 profiles
- RFC 7515 JWS — the signing envelope
- RFC 7517 JWK / JWKS — where the verifier finds the public key
- RFC 7662 Introspection — the opaque-token alternative to 9068
- RFC 9396 RAR —
authorization_detailsrides as a public JWT claim - RFC 9449 DPoP — adds
cnf.jktto bind 9068 tokens to a sender - RFC 8705 mTLS — adds
cnf.x5t#S256for cert-bound 9068 tokens