-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(client,core): RFC 9207 iss parameter validation on authorization responses (SEP-2468) #2272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a5b549f
feat(client,core): RFC 9207 iss parameter validation on authorization…
mattzcarey 4f6ffbc
fix(client): gate RFC 9207 fail-closed iss rejection behind explicit …
mattzcarey d31fabe
fix(client): document issuer callback plumbing
mattzcarey c09df58
fix(client): validate discovered authorization server issuer
mattzcarey 573aa25
fix(client): preserve legacy OAuth metadata fallback
mattzcarey 5248726
fix(client): clarify issuer metadata validation
mattzcarey ffb20b9
fix(client): recover stale OAuth discovery cache
mattzcarey 33316f2
fix(client): preserve Cross-App IdP issuer aliases
mattzcarey 0903854
fix(client): preserve legacy issuer fallback during auth
mattzcarey 98ad946
fix(client): allow cached malformed legacy issuer fallback
mattzcarey 9aa3a7e
fix(client): repair sep-2468 rebase
mattzcarey e45f240
fix(test): preserve missing callback issuer
mattzcarey f8384bb
fix(client): clarify authorization issuer validation
mattzcarey a6f766a
fix(client): tighten issuer validation edge cases
mattzcarey a755912
fix(docs): clarify sep-2468 issuer validation docs
mattzcarey 59193d1
fix(client): clarify authorization response issuer exports
mattzcarey cf6fbf2
fix(changeset): narrow sep-2468 release note
mattzcarey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| '@modelcontextprotocol/client': minor | ||
| --- | ||
|
|
||
| Add RFC 9207 `iss` parameter validation for authorization responses (SEP-2468). The client exports a new `validateAuthorizationResponseIssuer()` helper, | ||
| `auth()` accepts an optional `iss`, and `StreamableHTTPClientTransport.finishAuth()` / `SSEClientTransport.finishAuth()` accept an optional `{ iss }` second argument. The `iss` option is tri-state: a string is validated by exact comparison against the issuer recorded in the | ||
|
Check warning on line 6 in .changeset/sep-2468-iss-validation.md
|
||
| authorization server metadata before the authorization code is sent to any token endpoint (mismatch rejects the response without processing any other response parameters); `null` asserts the caller inspected the authorization response and it carried no `iss`, enabling the RFC | ||
| 9207 fail-closed rejection when the AS advertises `authorization_response_iss_parameter_supported: true`; `undefined` (omitted) skips RFC 9207 response validation, so existing `finishAuth(code)` callers that never see the authorization response are unaffected. | ||
|
|
||
| Discovery also now validates authorization-server metadata issuer values per RFC 8414 Section 3.3. Metadata discovered for a PRM-provided authorization server URL is rejected when its `issuer` does not match that URL, and the public `discoverAuthorizationServerMetadata()` helper | ||
| throws on mismatches or invalid issuer identifiers unless called with `{ validateIssuer: false }` for intentional alias discovery. Cached discovery state is also validated; stale legacy no-PRM fallback state that saved the MCP server origin before learning a distinct metadata | ||
| issuer is ignored and refreshed. For legacy servers without protected resource metadata, metadata is still discovered at the MCP server origin; when that metadata names a distinct issuer, the SDK now treats the metadata `issuer` as the authorization server URL for persisted | ||
| discovery state and fallback endpoint construction. | ||
|
|
||
| Cross-App Access IdP discovery (`discoverAndRequestJwtAuthGrant()` / `CrossAppAccessProvider`) intentionally skips the RFC 8414 issuer-echo check, so configured IdP alias URLs whose metadata names a canonical issuer keep working. | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.