Repository navigation
Allow servers to advertise lack of RFC 8707 resource indicator support - #1953
Open
erwinkramer wants to merge 2 commits into
Open
erwinkramer wants to merge 2 commits into
erwinkramer wants to merge 2 commits into
Conversation
Some authorization servers, such as Microsoft Entra ID, do not support RFC 8707 resource indicators and reject authorization and token requests that include the resource parameter (AADSTS901002). Removing the parameter unilaterally on the client is not acceptable: the MCP specification requires it, and it binds the token audience, so omitting it silently opens a token theft window against servers that do support it. Instead, the decision is delegated to the server, which is the component that validates the token. Add an optional resource_indicators_supported extension to the protected resource metadata (RFC 9728). Servers that use an authorization server without RFC 8707 support set it to false, and clients then omit the resource parameter and bind the token audience through scopes. Changes: - ProtectedResourceMetadata: new optional ResourceIndicatorsSupported property (null = assume support, the spec-conformant default). - ClientOAuthProvider: when the protected resource metadata advertises the lack of support, omit the resource parameter from authorization, token, and refresh requests and log a warning explaining that audience is bound by scopes only. - Tests: end-to-end test simulating an Entra-like authorization server that rejects the resource parameter in both authorization and token requests, plus coverage for the new Clone() property. Fixes modelcontextprotocol#648
Author
|
Tagging @jeffhandley and @halter73 since you've both been involved in the related issue and previous attempts to resolve it. |
This branch has not been deployed
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.
Some authorization servers, such as Microsoft Entra ID, do not support RFC 8707 resource indicators and reject authorization and token requests that include the resource parameter (AADSTS901002). Removing the parameter unilaterally on the client is not acceptable: the MCP specification requires it, and it binds the token audience, so omitting it silently opens a token theft window against servers that do support it.
Instead, the decision is delegated to the server, which is the component that validates the token. Add an optional
resource_indicators_supportedextension to the protected resource metadata (RFC 9728). Servers that use an authorization server without RFC 8707 support set it to false, and clients then omit the resource parameter and bind the token audience through scopes.Changes:
Fixes #648
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context