Skip to content

Use none as the token-endpoint auth method for CIMD public clients - #1845

Open
ump45nose wants to merge 1 commit into
modelcontextprotocol:mainfrom
ump45nose:contrib/dae77e2a37e0
Open

Use none as the token-endpoint auth method for CIMD public clients#1845
ump45nose wants to merge 1 commit into
modelcontextprotocol:mainfrom
ump45nose:contrib/dae77e2a37e0

Conversation

@ump45nose

Copy link
Copy Markdown

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

AI assistance disclosure: AI was used to discover this opportunity and draft the change or text. The submission was checked against the prepared artifact and recorded verification evidence.

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
@ump45nose

Copy link
Copy Markdown
Author

Additional verification context: the change is limited to selecting "none" for CIMD public clients, with regression coverage for servers that advertise client_secret_basic before none. The focused net10.0 AuthTests run passed 67 tests, including the new precedence case related to #1612.

GitHub currently shows no completed check jobs or reviews for this commit, so the evidence above refers to the recorded local verification only.

AI assistance disclosure: AI was used to discover this opportunity and draft the change or text. The submission was checked against the prepared artifact and recorded verification evidence.

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.

1 participant