Skip to content

fix(auth): preserve authorization endpoint query params#2865

Open
go165 wants to merge 2 commits into
modelcontextprotocol:mainfrom
go165:go165/fix-oauth-authorization-endpoint-query
Open

fix(auth): preserve authorization endpoint query params#2865
go165 wants to merge 2 commits into
modelcontextprotocol:mainfrom
go165:go165/fix-oauth-authorization-endpoint-query

Conversation

@go165

@go165 go165 commented Jun 14, 2026

Copy link
Copy Markdown

Summary

  • build OAuth authorization URLs by merging generated OAuth params into the discovered authorization endpoint query instead of always appending a new ?
  • preserve provider-required endpoint parameters such as prompt=select_account
  • add an interaction regression test for an authorization endpoint that already contains query params

Fixes #2776

Validation

  • .venv/bin/python -m pytest tests/interaction/auth/test_authorize_token.py
  • .venv/bin/python -m ruff check src/mcp/client/auth/oauth2.py tests/interaction/auth/test_authorize_token.py
  • .venv/bin/python -m ruff format --check src/mcp/client/auth/oauth2.py tests/interaction/auth/test_authorize_token.py
  • git diff --check

@go165 go165 force-pushed the go165/fix-oauth-authorization-endpoint-query branch from af82afa to 06cd85a Compare June 14, 2026 09:59
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 handler doesn't support redirect URLs with params

1 participant