OAuth 2.1 (draft-ietf-oauth-v2-1)
Baseline alignment landed in PR 296 (issue 140). Audit table: docs/OAUTH21_ALIGNMENT.md(../OAUTH21_ALIGNMENT.md)
Source: docs/oauth/RFC_oauth21.md
OAuth 2.1 (draft-ietf-oauth-v2-1) ¶
Status: Internet-Draft (active)
Latest: draft-ietf-oauth-v2-1
L-tier / T-tier: L0 · T0–T8 (foundational)
OneAuth coverage: Baseline alignment landed in PR 296 (issue 140). Audit table:docs/OAUTH21_ALIGNMENT.md
See also:RFC_6749.md·RFC_9700.md·LANDSCAPE.md
In one sentence ¶
OAuth 2.1 is RFC 6749 with the Security BCP (RFC 9700), PKCE (RFC 7636), and
Bearer Token Usage (RFC 6750) consolidated into a single document — and with
the grants that two decades of attacks killed (implicit, ROPC) removed.
Status reality. 2.1 is still an active Internet-Draft (currently
draft-ietf-oauth-v2-1). There is no public timeline for promotion to
RFC. OAuth 2.0 remains the published standard the production world
deploys. Treating 2.1 as “the spec to build to today” is reasonable
for new AS deployments; treating it as a hard requirement for existing
2.0 deployments is premature — those will likely live another decade.
What problem does it solve? ¶
| Without 2.1 | With 2.1 |
|---|---|
| To deploy an OAuth AS securely in 2025 you must read RFC 6749 + RFC 6750 + RFC 7636 + RFC 9700 + ~10 errata threads and synthesize them yourself | One document; the synthesis is the spec |
| Insecure flows (implicit, ROPC) are still legal per 6749 — deployments quietly leave them on | Removed at the spec level — implementations have a normative reason to delete the code |
| “PKCE is for public clients” is a popular misreading of 7636 | 2.1 mandates PKCE for all clients, confidential included |
iss on redirect is “you should consider this” in 9700 |
2.1 makes it required for new deployments |
Important framing: 2.1 does not invent new protocol surface. It’s
subtractive and prescriptive. If you already follow 9700 + 7636 against
6749, you’re 90% of the way to 2.1. The remaining 10% is closing the legacy
trapdoors.
Relatable example ¶
You inherit an OAuth deployment from 2015. The audit asks: “are we OAuth 2.1
compliant?” You don’t want to read four RFCs. You want a checklist. 2.1 is
that checklist:
- Implicit grant on? Turn it off. (§2.1.2)
- ROPC password grant on? Turn it off. (§7.6)
- PKCE optional? Make it mandatory for everyone. (§4.1.1)
- Redirect URI matching wildcard / substring? Exact match only. (§3.1.2.2)
- Refresh tokens long-lived without rotation? Rotate + detect reuse. (§6.1)
- Bearer tokens in
?access_token=...query params? Remove that path. (§5.4)
Each item maps to a code change. The audit becomes a project plan.
Key changes vs 2.0 ¶
| Area | OAuth 2.0 (6749) | OAuth 2.1 |
|---|---|---|
| Implicit grant | Allowed (§4.2) | Removed |
| Password grant (ROPC) | Allowed (§4.3) | Removed |
| PKCE | SHOULD for public clients (per 7636/BCP) | MUST for all clients on auth-code |
| PKCE methods | plain and S256 |
S256 only (plain rejected) |
| Redirect URI matching | Various (vendor) | Exact string match |
| Redirect URI scheme | Any | HTTPS required (loopback exempt per RFC 8252) |
| Bearer in query string | Discouraged (6750 §2.3) | Forbidden (§5.4) |
| Refresh token | No rotation mandate | Rotation + family-revoke on reuse required |
| Mix-up defense | Nothing | iss on redirect per RFC 9207 required |
Relation to other RFCs ¶
OAuth 2.1 is the spec-level digest of the L0 spine:
6749 (the framework)
|
+— 6750 (how to USE a bearer token) ─────────┐
| \
+— 7636 (PKCE — proves the client requesting > OAuth 2.1
| the code is the same client /
| exchanging it) /
| /
+— 9700 (the Security BCP — accumulated /
wisdom from a decade of attacks) ─/
Reading 2.1 after you’ve read 9700 makes every restriction click. Reading
2.1 first leaves you wondering “but why?” — the answers are in 9700.
Wire example ¶
There is no “2.1 wire format” — the wire is still 6749’s wire. What 2.1
changes is what’s required vs allowed. The example from
RFC_6749.md is already 2.1-compliant because it carries
PKCE (S256), an iss on the redirect, and exact redirect URI matching at
both registration and authorization. Under pre-2.1, the same /authorize
request without code_challenge would have been accepted. Under 2.1, it’s
rejected:
HTTP/1.1 302 Found
Location: https://client.example.com/cb?error=invalid_request
&error_description=code_challenge+is+required+%28PKCE%29
&state=xyzABC
&iss=https://as.example.com
OneAuth’s /authorize answers that request with that redirect, error and
iss included, from AuthorizationHandler.ValidateValues and
AuthorizationHandler.ErrorRedirect (apiauth/authorize.go) when
EmitIssParameter is on. The reference server turns it on whenever
code_flow is enabled.
Where it lands on the OAuth abstraction ¶
- L0 spine. 2.1 is the spine; it’s the document that legitimizes the
constraints downstream L-tiers assume. - T-tier: T0–T8. Every T-step has at least one 2.1 paragraph against
it — by design, since 2.1 is “all of 6749 + the defenses.”
OAuth 2.0 status ¶
2.1 is built on 2.0; the wire is identical. The relationship is strict
mode profile, not replacement. 2.0 deployments remain fully legal — RFC
6749 is the Internet Standard and is not deprecated. 2.1 is a draft.
OAuth 2.1 status ¶
Active Internet-Draft (draft-ietf-oauth-v2-1) under WG review. No fixed
promotion date. The major IdPs (Google, GitHub, Azure AD, Okta, Auth0) ship
selected 2.1 defaults today — PKCE-everywhere is widely on; query-param
bearer is widely off — but they brand themselves as “OAuth 2.0 with
[selected] BCP defenses,” not as “OAuth 2.1.” That’s a fair stance.
For OneAuth, see the audit-table verdict in
docs/OAUTH21_ALIGNMENT.md. The shortcut:
- Compliant by default on all 9 rows of the audit table.
- ROPC and query-param bearer are off unless a deployment opts in (issues 294 and 295, both closed).
FAPI2refuses ROPC outright. - The reference server still wires the password grant outside
fapi2: true.
Migration path ¶
This is the only doc in this folder whose primary purpose is the migration
question. The path is:
- Audit against
docs/OAUTH21_ALIGNMENT.mdrows. This is the row-by-row
gap analysis. - Close gaps that have no business cost — PKCE-required, S256-only,
exact redirect URI matching, refresh rotation. These break nothing
correctly-implemented clients do today. - Plan migrations for 2.0-legal-but-2.1-illegal features:
- ROPC: off by default in the library since issue 294. A deployment
opts in by settingOneAuthConfig.PasswordGranter
(NewPasswordGranter);localauth/HTTP login is the alternative. - Query-param bearer: off by default since issue 295. A deployment
opts in withAPIMiddleware.LegacyQueryParamBearer;docs/DEMOS.md
lists the WebSocket alternatives (subprotocol headers, initial-frame
auth, short-lived per-connection tickets).
- ROPC: off by default in the library since issue 294. A deployment
- Treat the dual-status as a feature. OneAuth-as-AS being 2.1-strict
while OneAuth’s SDK and middleware speak 2.0 to the world is the
intended deployment posture. Don’t try to force the SDK side to be 2.1
too — you’d lose interop with every production IdP.
When NOT to use it ¶
If you maintain a legacy IdP for clients that depend on ROPC or implicit, or
that haven’t yet shipped PKCE on their client SDKs, you’ll leave 6749-only
flows enabled for the deprecation window. 2.1 is a destination — pace it.
OneAuth’s own ROPC and query-param-bearer carve-outs (see
docs/OAUTH21_ALIGNMENT.md rows 3 and 7) are
exactly this kind of deprecation window.
OneAuth status ¶
The single source of truth is docs/OAUTH21_ALIGNMENT.md.
The row-by-row table there is kept in lock-step with the codebase as each
non-compliance is closed. As of 0.2.1:
| 2.1 requirement | OneAuth verdict | Tracking |
|---|---|---|
| 1. PKCE required for all auth-code | Compliant (server enforces on /authorize, and checks the shape: an S256 challenge is 43 base64url characters, a verifier 43 to 128 unreserved characters) |
landed PR 297; shape checks 0.1.49 |
| 2. Implicit grant removed | Compliant (/authorize accepts only response_type=code) |
— |
| 3. ROPC removed | Compliant by default (nil OneAuthConfig.PasswordGranter answers unsupported_grant_type; FAPI2 refuses it) |
issue 294 (closed) |
| 4. Exact redirect URI matching | Compliant (DCR + /authorize). An http loopback redirect matches on any port, per RFC 8252 §7.3. /authorize with no client registry refuses every request unless AllowAnyRedirectURI is set. |
landed PR 296 / 297; loopback 0.1.38; registry 0.1.49 |
| 5. PKCE S256-only | Compliant (plain only with AllowPlainPKCE) |
landed PR 297 |
| 6. HTTPS redirect URIs | Compliant (DCR) | landed PR 296; stricter DCR checks 0.1.50 |
| 7. Bearer NOT in query string | Compliant by default (APIMiddleware.LegacyQueryParamBearer is empty unless set) |
issue 295 (closed) |
| 8. Refresh token rotation | Compliant. The token must belong to the presenting client, and a confidential owner must authenticate. DisableRefreshTokenRotation turns rotation off for FAPI 2.0. |
client binding 0.1.41; optional rotation 0.1.43 |
| 9. Authorization code single use | Compliant. A reused code is refused and the refresh family it issued is revoked, along with its access token when OneAuthConfig.Blacklist is set. |
0.1.57 (issue 429) |
If a row above moves, update docs/OAUTH21_ALIGNMENT.md and this doc and
LANDSCAPE.md §6 in the same change.
Related RFCs ¶
- RFC 6749 — the framework 2.1 builds on
- RFC 6750 — Bearer; 2.1 §5 mostly re-exports 6750 with the query-string carve-out removed
- RFC 7636 — PKCE; 2.1 makes it universal
- RFC 9700 — the BCP whose normative recommendations 2.1 promotes to MUST
- RFC 9207 —
isson redirect; 2.1 mandates - RFC 8252 — Native Apps; loopback redirect exemption
Spec links ¶
- draft-ietf-oauth-v2-1 (latest)
- WG OAuth status page for the current revision
Maintenance note. When 2.1 graduates to RFC status, update this file’s
title, status, and the spec-link section, and addRFC_xxxx.mdredirection
if the filename moves.