Skip to content

fix: omit OAuth resource on token refresh#2590

Open
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/oauth-refresh-resource-param
Open

fix: omit OAuth resource on token refresh#2590
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/oauth-refresh-resource-param

Conversation

@he-yufeng
Copy link
Copy Markdown

Summary

  • omit RFC 8707 resource from refresh_token requests
  • normalize root protected-resource URLs so Pydantic's bare-domain trailing slash does not leak into the OAuth resource value
  • keep resource on authorization and initial token exchange requests

Fixes #2578.

To verify

  • python -m py_compile src\mcp\client\auth\oauth2.py tests\client\test_auth.py
  • uv run pytest tests\client\test_auth.py -q --basetemp .tmp\pytest -p no:cacheprovider
  • uv run ruff check src\mcp\client\auth\oauth2.py tests\client\test_auth.py
  • uv run ruff format --check src\mcp\client\auth\oauth2.py tests\client\test_auth.py
  • uv run pyright src\mcp\client\auth\oauth2.py tests\client\test_auth.py
  • git diff --check

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.

OAuth token refresh sends RFC 8707 resource parameter that Entra ID v2.0 rejects (AADSTS9010010)

1 participant