RFC 9207 — OAuth 2.0 Authorization Server Issuer Identification
Implemented (apiauth/authorize.go EmitIssParameter)
Source: docs/oauth/RFC_9207.md
RFC 9207 — OAuth 2.0 Authorization Server Issuer Identification ¶
Status: Standards Track
Published: 2022-03
L-tier / T-tier: L2 · T4 (redirect back)
OneAuth coverage: Implemented (apiauth/authorize.goEmitIssParameter)
See also:RFC_9700.md·RFC_8414.md·LANDSCAPE.md
In one sentence ¶
RFC 9207 adds an iss query parameter to the redirect from /authorize
back to the client — a tiny piece of context the client can verify against
its expected AS, closing the mix-up class of attacks.
What problem does it solve? ¶
| Without 9207 | With 9207 |
|---|---|
Client receives a code on its callback but doesn’t know which AS issued it |
Client reads iss from the redirect query string and checks it matches the AS it sent the user to |
| Mix-up attacks (compromised proxy swaps discovery doc so user authenticates at the wrong AS) succeed silently | Client detects the wrong issuer before exchanging the code at /token |
| Multi-tenant clients with several upstream ASes have to infer issuer from state | One query parameter — explicit, machine-readable |
9207 is one of the smallest RFCs in OAuth — six pages of normative text. The
fix is one query string parameter and one verification line of client code.
That’s the entire spec.
Relatable example ¶
A budgeting app supports linking accounts from two banks. The user clicks
“Connect Bank A.” A compromised reverse proxy swaps Bank A’s discovery
metadata to point /authorize at Bank B’s URL. The user, expecting Bank A,
logs in at Bank B (who looks just like Bank A). Bank B issues a code and
redirects to the budgeting app’s callback.
Without 9207, the budgeting app gets ?code=xxx&state=yyy — no way to
tell which bank just issued the code. It POSTs to Bank A’s /token (per
its stored config), Bank A rejects (the code is from Bank B). Or worse, the
attacker arranged the discovery swap such that the budgeting app also
uses Bank B’s /token, gets a token, treats it as Bank A’s token. User’s
Bank A view is now showing Bank B account data.
With 9207, the redirect carries ?code=xxx&state=yyy&iss=https://bankB.com.
Budgeting app sees iss mismatches the expected https://bankA.com —
aborts before any token exchange. Attack fails.
Key concepts ¶
- The
issquery parameter is the entire wire spec. It carries the
issuer URL of the AS that just authenticated the user — the same URL
that’s in the AS’s discovery metadataissuerfield. - Two checks the client must do (§2.4):
issmatches the issuer the client expected (the one it used for
this auth request)issmatches the value the client previously received in the AS’s
discovery doc
- Errors get
isstoo — even error redirects carry it, so the client
can verify “this is a legit error from the expected AS” vs “a
redirect-spoof error from an attacker.” - AS metadata advertisement (RFC 8414’s
authorization_response_iss_parameter_supported) lets clients know
whether to requireiss(some IdPs ship 9207; others don’t). - Backward compatible. Clients that ignore unknown params and ASes
that don’t emitissinteroperate fine. The defense is opt-in by
each side; both sides supporting it closes the attack.
Wire example ¶
Successful auth-code redirect with iss:
HTTP/1.1 302 Found
Location: https://client.example.com/cb?code=Spl...&state=xyz&iss=https://as.example.com
^^^^^^^^^^^^^^^^^^^^^^^^^^
Error redirect (per §3) also carries iss:
HTTP/1.1 302 Found
Location: https://client.example.com/cb?error=invalid_scope&state=xyz&iss=https://as.example.com
Client verification (pseudocode):
expected_issuer = "https://as.example.com"
actual_issuer = request.GET["iss"]
if actual_issuer != expected_issuer:
abort("mix-up attack — refusing to exchange code")
That’s the whole defense. One string comparison.
Where it lands on the OAuth abstraction ¶
- L2 lifecycle & discovery. 9207 is the runtime check that pairs with
8414’s discovery — discovery says “I am issuer X”; 9207 lets the client
verify “yes, the AS that just answered IS issuer X.” - T4 (redirect back). The check fires after the AS responds, before
the code is exchanged at the token endpoint. - Named in RFC 9700 §4.4 as the canonical defense against
the §4.4 mix-up attack family.
OAuth 2.0 status ¶
Published 2022 — not part of bare 6749. Optional under 2.0 but strongly
recommended by RFC 9700 (BCP). Adoption is climbing — major IdPs and
client SDKs have been adding support since 2023.
OAuth 2.1 status ¶
Required by OAuth 2.1 for new deployments (per OAuth 2.1 §4.1.2). Both
emission (AS side) and verification (client side) are mandated.
Migration path (no-9207 → 9207) ¶
For ASes:
- Add the parameter to successful redirects. Append
&iss=<issuer-URL>to theLocationheader on both code and error
redirects. - Advertise support in AS metadata:
authorization_response_iss_parameter_supported: true. - Keep both client populations working. Old clients ignore unknown
params; new clients verify.
For clients:
- Read
issfrom the redirect query string if present. - Verify against the expected issuer before exchanging the code.
- Fall back to “is the AS advertised as supporting it?” — if so,
missingissis an attack signal; otherwise it’s a legacy AS.
The asymmetry — AS can ship support unilaterally, client benefits if it
opts in — means there’s no chicken-and-egg. ASes that ship support help
all their clients incrementally.
When NOT to use it ¶
You will always ship 9207 emission on a new AS — it’s free and unlocks the
defense for any client that opts in. The only carve-out:
- AS deployments that don’t have an
/authorizeendpoint at all (pure
back-channel grants — client_credentials, jwt-bearer, device flow). The
mix-up attack family doesn’t apply where there’s no redirect.
OneAuth status ¶
| 9207 surface | Status | Where (grep-verified) | Notes |
|---|---|---|---|
iss parameter on success redirect |
Implemented | apiauth/authorize.go AuthorizationHandler.SuccessRedirect emits when EmitIssParameter && IssuerURL != "" |
Opt-in per deployment |
iss parameter on error redirect |
Implemented | apiauth/authorize.go AuthorizationHandler.ErrorRedirect, same toggle |
Per RFC 9207 §3 |
EmitIssParameter toggle on AuthorizationHandler and AuthorizeMountConfig |
Implemented | apiauth/authorize.go AuthorizationHandler.EmitIssParameter; apiauth/authorize_mount.go AuthorizeMountConfig.EmitIssParameter |
Default off; enable per deployment |
MountAuthorize passes through |
Implemented | apiauth/authorize_mount.go MountAuthorize copies IssuerURL and EmitIssParameter onto the AuthorizationHandler it builds |
Wired in the convenience mount helper |
IssuerURL required by MountAuthorize |
Implemented | apiauth/authorize_mount.go MountAuthorize panics when IssuerURL is empty, whether or not EmitIssParameter is set |
Hard fail at boot, not at request time |
AS metadata advertisement (authorization_response_iss_parameter_supported) |
Implemented | apiauth/as_metadata.go ASServerMetadata.AuthorizationResponseIssParameterSupported |
Optional; pair with EmitIssParameter on the same deployment |
| Reference server | Implemented | cmd/oneauth-server/main.go mounts /authorize with EmitIssParameter: true; cmd/oneauth-server/metadata.go serverASMetadata advertises authorization_response_iss_parameter_supported |
Both only with code_flow enabled. Before 0.1.51 the server never emitted iss |
| Test coverage | Implemented | apiauth/authorize_test.go TestSuccessRedirect_EmitsIssWhenConfigured, TestSuccessRedirect_OmitsIssWhenNotConfigured, TestRedirectOverride_CanStripIss; cmd/oneauth-server/metadata_test.go |
Covers opt-in, opt-out and the server’s metadata |
OneAuth ships the AS-side correctly. Client-side verification lives in
client/browser_login.go and would be a separate audit (covered under the
client SDK’s broader 2.1 alignment work).
Related RFCs ¶
- RFC 9700 — §4.4 names this as the canonical mix-up defense
- RFC 8414 —
authorization_response_iss_parameter_supportedmetadata - RFC 6749 — the framework whose redirect 9207 augments
- OAuth 2.1 draft — §4.1.2 makes 9207 required