Skip to content

Fix CIMD clients getting required_scopes instead of valid_scopes#3836

Merged
jlowin merged 1 commit intomainfrom
fix/cimd-default-scope-valid-scopes
Apr 12, 2026
Merged

Fix CIMD clients getting required_scopes instead of valid_scopes#3836
jlowin merged 1 commit intomainfrom
fix/cimd-default-scope-valid-scopes

Conversation

@jlowin
Copy link
Copy Markdown
Member

@jlowin jlowin commented Apr 11, 2026

When a CIMD client (like Claude Code) connects to an OAuthProxy with both required_scopes and valid_scopes configured, it gets registered with only required_scopes. This happens because CIMD clients bypass the RegistrationHandler (which applies valid_scopes via ClientRegistrationOptions), and the _default_scope_str fallback was built from required_scopes alone. Any authorization request for a scope beyond the required set gets rejected with invalid_scope before it ever reaches the upstream IdP.

The fix is a one-line change: _default_scope_str now prefers valid_scopes, matching the logic already used when constructing ClientRegistrationOptions.

Closes #3828

@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. auth Related to authentication (Bearer, JWT, OAuth, WorkOS) for client or server. labels Apr 11, 2026
@jlowin jlowin merged commit 1d39e26 into main Apr 12, 2026
9 checks passed
@jlowin jlowin deleted the fix/cimd-default-scope-valid-scopes branch April 12, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth Related to authentication (Bearer, JWT, OAuth, WorkOS) for client or server. bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OAuthProxy: CIMD clients get required_scopes instead of valid_scopes as default

1 participant