Skip to content

feat: validate OAuth authorization response issuer#896

Open
michaelneale wants to merge 2 commits into
mainfrom
micn/sep-2468-iss-validation
Open

feat: validate OAuth authorization response issuer#896
michaelneale wants to merge 2 commits into
mainfrom
micn/sep-2468-iss-validation

Conversation

@michaelneale

Copy link
Copy Markdown
Contributor

Summary

Implements SEP-2468 issuer (iss) validation for OAuth authorization responses.

  • records the expected issuer from authorization server metadata in the persisted PKCE/CSRF authorization state
  • validates the optional RFC 9207 iss callback parameter before exchanging the authorization code
  • rejects mismatched issuers, and rejects missing iss when the authorization server advertises authorization_response_iss_parameter_supported: true
  • adds issuer-aware callback helpers plus redirect URL parsing
  • updates the OAuth client example to pass through the callback iss parameter

Closes #876.

Testing

cargo test -p rmcp --lib transport::auth --features auth,client,transport-streamable-http-client-reqwest
cargo check --manifest-path examples/clients/Cargo.toml --example clients_oauth_client --all-features
git diff --check

@michaelneale michaelneale requested a review from a team as a code owner June 9, 2026 01:57
@github-actions github-actions Bot added T-core Core library changes T-examples Example code changes T-transport Transport layer changes labels Jun 9, 2026
@michaelneale michaelneale requested a review from jamadeo June 9, 2026 02:28

@jamadeo jamadeo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to do the right thing, but I can't find a remote MCP server that's adding iss to the callback to test with. Do you have one @michaelneale ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-examples Example code changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement SEP-2468: Recommend Issuer (iss) Parameter in Auth Responses

2 participants