Emit RFC 9207 iss on OAuth authorization responses - #125
Open
aterga wants to merge 1 commit into
Open
Conversation
Name the issuer on every /oauth authorization-response redirect with an
`iss` parameter, and advertise support via
`authorization_response_iss_parameter_supported` in the RFC 8414
authorization-server metadata.
RFC 9207 lets a client detect an authorization-server mix-up before it
redeems a code: it compares the response `iss` against the issuer it
started the flow with and rejects a mismatch. The value we emit is
byte-for-byte the metadata `issuer` (`{public_url}{mcp_path}`), which
clients compare by exact string.
`build_redirect` gains an `iss` argument and appends the (percent-encoded)
parameter after `code` and any `state`; `connect_redeem` threads the
issuer through all three redirect call sites, including the idempotent
replays. Only success redirects carry `iss`; the OAuth error paths render
pages or return JSON rather than redirecting to the client.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014T9N8USDfNK5yzznPGg7Ym
There was a problem hiding this comment.
Pull request overview
Adds RFC 9207 issuer identification to OAuth authorization responses and advertises support through RFC 8414 metadata.
Changes:
- Appends encoded
issvalues to successful authorization redirects. - Advertises issuer-parameter support in authorization-server metadata.
- Adds redirect encoding and metadata assertions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/auth.rs |
Emits iss, updates metadata, and tests redirect construction. |
tests/routers.rs |
Verifies the metadata support flag. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Name the issuer on every
/oauthauthorization-response redirect with anissparameter (RFC 9207), and advertise support viaauthorization_response_iss_parameter_supportedin the RFC 8414 authorization-server metadata.RFC 9207 lets a client detect an authorization-server mix-up before it redeems a code: a client that sees the metadata flag compares the response
issagainst the issuer it started the flow with and rejects a mismatch. The value we emit is byte-for-byte the metadataissuer({public_url}{mcp_path}), which clients compare by exact string. This is a natural fit for a path-issuer-per-instance server: a client that started at/mcpand is handed a code stamped for/mcp-betacan now catch it.This surfaced in the MCP 2026-07-28 alignment review as a small, spec-independent OAuth hardening win, implemented here on its own so it can land ahead of the larger alignment work.
Related issues
Changes
build_redirectgains anissargument and appends the percent-encoded&iss=...aftercodeand anystate.connect_redeembindslet iss = store.issuer();once and threads it through all three redirect call sites, including the two idempotent replays (existing-code andRedeemClaim::Existing).authorization_server_metadata(RFC 8414) now advertisesauthorization_response_iss_parameter_supported: true.iss; the OAuth error paths render pages or return JSON rather than redirecting to the client, so there is no error-redirect to stamp.build_redirect_encodes_code_state_and_isscovers ordering and encoding (with and without clientstate); the routers integration test asserts the new metadata flag.Testing
cargo build --locked --all-targetscargo test --locked --all-targets(165 tests: 151 lib + 6 main + 8 routers, all pass)cargo fmt --all/cargo clippy --all-targets(tree is warning-free) — repo tree has pre-existing rustfmt-version drift and clippy warnings indiscover.rs; no CI fmt/clippy gate exists, and this change adds nonenpm test --prefix monitoring/mcp-status(if the dashboard changed) — dashboard unchangedChecklist
🤖 Generated with Claude Code
https://claude.ai/code/session_014T9N8USDfNK5yzznPGg7Ym
Generated by Claude Code