fix: ProxyOAuthServerProvider: redirect_uri missing in token request#519
Merged
pcarleton merged 3 commits intomodelcontextprotocol:mainfrom May 21, 2025
Merged
Conversation
|
+1 I have the same trouble on my side |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #479: a critical issue in ProxyOAuthServerProvider where the redirect_uri parameter was missing from the token exchange request, causing token endpoints (like Amazon Cognito) to return 400/500 errors.
Motivation and Context
Issue: The ProxyOAuthServerProvider did not include the redirect_uri parameter in the /token request, violating the OAuth 2.0 spec.
Impact: This caused token endpoints to fail, preventing successful token exchanges.
Why Fix: The redirect_uri is required by the OAuth 2.0 spec and must match the one used during the /authorize request.
How Has This Been Tested?
Unit Tests: Added tests to verify that the redirect_uri is included in the token request.
Breaking Changes
None: This is a bug fix that does not change the public API or behavior of the ProxyOAuthServerProvider.
Types of changes
Checklist
Additional context
Implementation Notes: The fix updates the exchangeAuthorizationCode method to include the redirect_uri parameter in the token request.
Design Decisions: Ensured the fix adheres to the OAuth 2.0 spec and maintains backward compatibility.