Skip to content

Fix dynamic OAuth callback port during token exchange - #108

Open
lezama wants to merge 1 commit into
trunkfrom
fix/oauth-dynamic-callback-port
Open

Fix dynamic OAuth callback port during token exchange#108
lezama wants to merge 1 commit into
trunkfrom
fix/oauth-dynamic-callback-port

Conversation

@lezama

@lezama lezama commented Aug 6, 2026

Copy link
Copy Markdown

Summary

  • pass the selected OAuth callback URL to the token exchange
  • keep fixed-port behavior unchanged
  • add regression coverage for dynamically selected ports

Why

The provider registers a loopback redirect with port 0, then selects a concrete local port before authorization. The token exchange was still sending the original port 0 URL, so standards-compliant authorization servers rejected the code binding.

Testing

  • npm test -- --runInBand tests/unit/mcp-oauth-provider.test.ts
  • npm run 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.

1 participant