Skip to content

auth: propagate discovered scopes to DCR metadata before registration#1104

Open
spdeepak wants to merge 1 commit into
modelcontextprotocol:mainfrom
spdeepak:auth-dcr-scope-propagation
Open

auth: propagate discovered scopes to DCR metadata before registration#1104
spdeepak wants to merge 1 commit into
modelcontextprotocol:mainfrom
spdeepak:auth-dcr-scope-propagation

Conversation

@spdeepak

Copy link
Copy Markdown

auth: propagate discovered scopes to DCR metadata before registration

Fixes #1102

When using AuthorizationCodeHandler with DynamicClientRegistrationConfig, the SDK registers the DCR client before computing the requested scopes. If the caller doesn't set ClientRegistrationMetadata.Scope, the client is
registered without any scope restriction, causing invalid_scope errors on strict authorization servers.

This change moves scope computation above handleRegistration and propagates
discovered scopes into the DCR metadata when the caller hasn't explicitly
set a scope. Callers who explicitly set Scope are not affected.

@spdeepak spdeepak changed the title auth: propagate discovered scopes to DCR metadata before registration #1102 auth: propagate discovered scopes to DCR metadata before registration Jul 18, 2026
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.

auth: DCR registration omits scopes, causing invalid_scope on strict auth servers

1 participant