fix: add RFC 8707 resource validation to OAuth client#2069
Merged
felixweinberger merged 1 commit intov1.xfrom Feb 17, 2026
Merged
fix: add RFC 8707 resource validation to OAuth client#2069felixweinberger merged 1 commit intov1.xfrom
felixweinberger merged 1 commit intov1.xfrom
Conversation
21be170 to
2b24ca3
Compare
felixweinberger
commented
Feb 16, 2026
| discovery_response = httpx.Response( | ||
| 200, | ||
| content=b'{"resource": "https://api.example.com/mcp", "authorization_servers": ["https://auth.example.com"]}', | ||
| content=b'{"resource": "https://api.example.com/v1/mcp", "authorization_servers": ["https://auth.example.com"]}', |
Contributor
Author
There was a problem hiding this comment.
the new validation caught that the mock PRM resource didn't match the fixture's server URL
65d0957 to
b899f8e
Compare
pcarleton
requested changes
Feb 16, 2026
b899f8e to
005bcbc
Compare
9 tasks
Backport from main (PR #2010). The client now validates that the Protected Resource Metadata resource field matches the server URL before proceeding with authorization, rejecting mismatched resources per RFC 8707. This fixes the auth/resource-mismatch conformance test, bringing client conformance to 251/251 (100%) on v1.x.
005bcbc to
3cb4e7c
Compare
pcarleton
approved these changes
Feb 17, 2026
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.
Stacked on #2068.
Partial backport of #2010.
Motivation and Context
The conformance test
auth/resource-mismatchrequires the client to validate that the Protected Resource Metadata (PRM)resourcefield matches the server URL before proceeding with authorization (RFC 8707). This was implemented on main in PR #2010 but missing from v1.x.How Has This Been Tested?
Breaking Changes
None.
Types of changes
Checklist
Additional context
Backport of main PR #2010. The validation method rejects PRM resources that don't match the server URL, with trailing slash normalization to handle root URL variations.