Use none as the token-endpoint auth method for CIMD public clients - #1845
Open
ump45nose wants to merge 1 commit into
Open
Use none as the token-endpoint auth method for CIMD public clients#1845ump45nose wants to merge 1 commit into
ump45nose wants to merge 1 commit into
Conversation
A client identified by a Client ID Metadata Document is a public client: its identifier is a URL and it has no client secret, so it must authenticate at the token endpoint with 'none' and prove possession via PKCE. Previously ApplyClientIdMetadataDocument left the auth method unset, so GetAccessTokenAsync fell through to the first method the authorization server advertised. Servers like Auth0 advertise client_secret_basic first, which made the token exchange send a Basic header built from the CIMD URL and an empty secret and omit client_id from the body, so the exchange failed with 401 access_denied. ApplyClientIdMetadataDocument now sets the auth method to 'none'. The test OAuth server can advertise an arbitrary ordered auth-method list, and a new regression test proves a CIMD client authenticates when the server advertises client_secret_basic before none. Fixes modelcontextprotocol#1612
Author
|
Additional verification context: the change is limited to selecting GitHub currently shows no completed check jobs or reviews for this commit, so the evidence above refers to the recorded local verification only.
|
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.
Summary
Use none as the token-endpoint auth method for CIMD public clients
Verification
dotnet test tests/ModelContextProtocol.AspNetCore.Tests -f net10.0 --filter 'FullyQualifiedName~AuthTests' (67 passed); new CanAuthenticate_WithClientMetadataDocument_WhenServerAdvertisesClientSecretBasicFirst red-green verified (fails without the fix, passes with it)
Related to #1612