Use none as the token-endpoint auth method for CIMD public clients - #1845
Use none as the token-endpoint auth method for CIMD public clients#1845ump45nose wants to merge 1 commit into
Conversation
|
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.
|
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
c47d154 to
badcd5c
Compare
|
Rebased onto current
Force-pushed to the PR branch ( Reproduction note: build/test locally with
|
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