Skip to content

Conversation

@halter73
Copy link
Contributor

stephentoub
stephentoub previously approved these changes Dec 10, 2025
- Properly handle path segments in issuer path
- Include port in resource comparison
…PRM document

This is stricter than the TypeScript SDK which only checks that the resource prefix matches:
https://github.com/modelcontextprotocol/typescript-sdk/blob/06a4fd2332cd0ba8884e18b21ef4f7d03dea7b0d/src/shared/auth-utils.ts#L25

However RFC 9728 makes it clear that the resource name must be identical.

The resource value returned MUST be identical to the protected resource's resource identifier value into which the well-known URI path suffix was inserted to create the URL used to retrieve the metadata. If these values are not identical, the data contained in the response MUST NOT be used.

If the protected resource metadata was retrieved from a URL returned by the protected resource via the WWW-Authenticate resource_metadata parameter, then the resource value returned MUST be identical to the URL that the client used to make the request to the resource server. If these values are not identical, the data contained in the response MUST NOT be used.

https://datatracker.ietf.org/doc/html/rfc9728/#section-3.3
@halter73 halter73 merged commit 31f8d20 into main Dec 12, 2025
10 checks passed
@halter73 halter73 deleted the halter73/907 branch December 12, 2025 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants