Title: Validate the `iss` authorization-response parameter (RFC 9207 / SEP-2468) by Kludex · Pull Request #2921 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Validate the `iss` authorization-response parameter (RFC 9207 / SEP-2468) by Kludex · Pull Request #2921 · modelcontextprotocol/python-sdk
X Title: Validate the `iss` authorization-response parameter (RFC 9207 / SEP-2468) by Kludex · Pull Request #2921 · modelcontextprotocol/python-sdk
Description: Implements the first item of #2902: validate the RFC 9207 iss authorization-response parameter (SEP-2468). What changed The OAuth client validates the iss query parameter returned on the authorization-response redirect, and the issuer of discovered authorization server metadata. Comparison is simple string comparison per RFC 3986 §6.2.1 (no normalization): a mismatched iss is rejected, and a missing iss is rejected when the AS advertised authorization_response_iss_parameter_supported. callback_handler now returns AuthorizationCodeResult (code/state/iss) instead of tuple[str, str | None], so the redirect's iss reaches the validation. Breaking change — documented in docs/migration.md. Added authorization_response_iss_parameter_supported to OAuthMetadata. AnyHttpUrl appends a trailing slash to a bare authority (https://as → https://as/), which would defeat the byte-exact comparison the spec requires (iss-supported must accept https://host while iss-normalized must reject https://host/), so the recorded issuer is compared with that lone authority slash stripped. Conformance Flips auth/metadata-issuer-mismatch green (removed from both expected-failures baselines). The auth/iss-* scenarios validate iss correctly but stay baselined because they reach Dynamic Client Registration and trip the unimplemented SEP-837 application_type check — re-grouped under SEP-837 with accurate comments. Both conformance legs pass with no stale entries. Out of scope (separate PRs, tracked by #2902) SEP-837 (application_type), SEP-2350 (scope-union step-up), SEP-2352 (AS migration / credential binding). SEP-2207 (offline_access) is already done. AI Disclaimer This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.
Open Graph Description: Implements the first item of #2902: validate the RFC 9207 iss authorization-response parameter (SEP-2468). What changed The OAuth client validates the iss query parameter returned on the authoriza...
X Description: Implements the first item of #2902: validate the RFC 9207 iss authorization-response parameter (SEP-2468). What changed The OAuth client validates the iss query parameter returned on the authoriza...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2921
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9151f8e6-550a-394a-e022-b474fe078a5d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8366:4B803:22A4884:2E68418:6A599580 |
| html-safe-nonce | 732b4cd60933d8345b21ee6035d0a982d2273f0b4821c3d3787cd25e61ee5b19 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzY2OjRCODAzOjIyQTQ4ODQ6MkU2ODQxODo2QTU5OTU4MCIsInZpc2l0b3JfaWQiOiIxNjI0NDMwMjc0NjQwNzEzMDg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2b6e2faa3e99a9ce9ed7d23dcfbbb8a064aaa9453e7534ae863f1fff61a3d64d |
| hovercard-subject-tag | pull_request:3904056402 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2921/files |
| twitter:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| og:image:alt | Implements the first item of #2902: validate the RFC 9207 iss authorization-response parameter (SEP-2468). What changed The OAuth client validates the iss query parameter returned on the authoriza... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 737e0bf019c29d8431b268ae84d528b052789210 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width