| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good, couple of nits + could benefit from more tests
Sorry, something went wrong.
There was a problem hiding this comment.
Would be good to add expectations on resource param to tests/client/test_auth.py similar to https://github.com/modelcontextprotocol/typescript-sdk/pull/638/files#diff-68dc66b14905d1fc01dc142e244a7e13fbdf88062d3a0b426983c333ccdfc9ed
(doesn't look like there's tests for authorize.py or for provider.py yet, not sure how hard they'd be to add)
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM!
Sorry, something went wrong.
|
Heads up that I'm going to submit a PR imminently to omit the resource parameter when the PRM is not available and the server version is 3-26-2025 or earlier. Just caught up with @pcarleton on the need to retain backwards compatibility for earlier servers. Whether servers should be able to support more recent protocol versions without the resource parameter is an open question. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
RFC 8707 Resource Indicators Implementation
Background:
Spec Changes PR
rfc8707
TS Implementation
Additional changes for not requiring strict matching
Closes: #962
Implements Resource Indicators validation for OAuth 2.0 (RFC 8707; spec change)
.
Motivation and Context
Facilitate prevention of token theft/confusion attacks where a malicious MCP server steals tokens meant for other services by explicitly binding tokens to their intended resources and showing how a server can check this binding.
This security vulnerability was identified in modelcontextprotocol/modelcontextprotocol#544.
How Resource Indicators Work
Clients automatically include a resource parameter in their OAuth requests that identifies which MCP server they intend to access (e.g., resource=https://api.example.com/mcp). This happens transparently without any action from developers using the SDK.
Authorization Servers (AS) receive this resource parameter and include it in the tokens they issue, typically as the aud (audience) claim in JWT tokens. This cryptographically binds each token to its intended MCP server.
MCP Resource Servers (RS) can verify that incoming tokens were specifically issued for them by checking the audience claim matches their server URL. With --oauth-strict enabled, the server rejects tokens that don't include the correct resource identifier, preventing token confusion attacks.
Breaking Changes
While the change is breaking at a protocol level, it should not require code changes from SDK users (just SDK version bumping).