Skip to content

feat: validate OAuth authorization response issuer - #896

Merged
michaelneale merged 2 commits into
mainfrom
micn/sep-2468-iss-validation
Jun 10, 2026
Merged

feat: validate OAuth authorization response issuer#896
michaelneale merged 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 ownerJune 9, 2026 01:57
@github-actionsgithub-actionsBot 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 jamadeoJune 9, 2026 02:28

@jamadeojamadeo 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 ?

@michaelneale

Copy link
Copy Markdown
ContributorAuthor

No. In this case we are relying heavily on the testing infrastructure I think, low risk enough?

@michaelneale
michaelneale merged commit 2d3d187 into mainJun 10, 2026
18 checks passed
@michaelneale
michaelneale deleted the micn/sep-2468-iss-validation branch June 10, 2026 03:08
@github-actionsgithub-actionsBot mentioned this pull request Jun 10, 2026
@DaleSeoDaleSeo modified the milestone: 2026-07-28 specJul 13, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2026-07-28T-coreCore library changesT-examplesExample code changesT-transportTransport 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

3 participants

@michaelneale@jamadeo@DaleSeo