Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

Fix OAuth scope selection using wrong parameter#1632

Closed
jlowin wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/python-sdk:mainfrom
jlowin:fix/oauth-scope-selection-bugjlowin/mcp-python-sdk:fix/oauth-scope-selection-bugCopy head branch name to clipboard
Closed

Fix OAuth scope selection using wrong parameter#1632
jlowin wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/python-sdk:mainfrom
jlowin:fix/oauth-scope-selection-bugjlowin/mcp-python-sdk:fix/oauth-scope-selection-bugCopy head branch name to clipboard

Conversation

@jlowin
Copy link
Contributor

@jlowin jlowin commented Nov 15, 2025

Fixes a bug introduced in #1586 where the OAuth scope selection strategy was incorrectly passing the resource metadata URL instead of the scope from the WWW-Authenticate header.

AFAICT this breaks all Python MCP clients that connect to servers with WWW headers because it treats the URL as a scope with highest priority.

The get_client_metadata_scopes() function expects the first parameter to be the scope string extracted from the WWW-Authenticate header. However, in this case it was incorrectly passing www_auth_resource_metadata_url (a URL) instead of calling extract_scope_from_www_auth(response) to get the actual scope value.

Closes #1630

@jlowin
Copy link
Contributor Author

jlowin commented Nov 15, 2025

This has been addressed identically in #1631, closing in favor of that PR.

@jlowin jlowin closed this Nov 15, 2025
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.

OAuth2: Protected-resource URL passed as scope instead of parsed scope

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.