feat: Add openid-configuration Auth server metadata discovery fallback#651
Closed
2underscores wants to merge 2 commits intomodelcontextprotocol:mainfrom
Closed
feat: Add openid-configuration Auth server metadata discovery fallback#6512underscores wants to merge 2 commits intomodelcontextprotocol:mainfrom
2underscores wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
- Add support for /.well-known/openid-configuration endpoint as fallback to oauth standard .well-known/oauth-authorization-server - Addresses GitHub discussion modelcontextprotocol#563
Contributor
Author
|
Might close this, I think a proper upstream fix has just been merged to the MCP SDK but will come in next version or so - modelcontextprotocol/typescript-sdk#652 |
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.
openid-configurationnot justoauth-authorization-server#563Motivation and Context
Fixes deviation in auth server metadata discovery endpoints supported between MCP and OAuth spec. Adds fallback to
.well-known/openid-configurationand also attempts both potential placements of.well-known/openid-configuration.From RFC8414:
How Has This Been Tested?
Locally tested against 2 MCP servers, one an azure style metadata endpoint, the other the oauth standard endpoint.
Breaking Changes
No
Types of changes
Additional context
IMO this fix actually belongs inside the
discoverOAuthMetadatamethod at@modelcontextprotocol/sdk/client/auth.js, alongside a spec update. If preferred i can move this change over to that repo instead to fix it at underlying lib layer. Included it here as unsure why it's not actually in the core lib and wondering if i'm misunderstanding spec or it's just a gap. At least this one is forwards compatible with that (wraps that method with a fallback to openid-config if it fails)