-
Notifications
You must be signed in to change notification settings - Fork 14.1k
fix(core): preserve registrationUrl in OAuth config merges #20992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
88b2a6a
a1ce9cf
ab11c6f
80e8422
4dc6657
3b38ab0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -321,6 +321,7 @@ export class MCPOAuthProvider { | |
| authorizationUrl: discoveredConfig.authorizationUrl, | ||
| issuer: discoveredConfig.issuer, | ||
| tokenUrl: discoveredConfig.tokenUrl, | ||
| registrationUrl: discoveredConfig.registrationUrl, | ||
|
struckoff marked this conversation as resolved.
struckoff marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While this line correctly preserves the validated
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in the latest commit: the fallback path in |
||
| scopes: config.scopes || discoveredConfig.scopes || [], | ||
| // Preserve existing client credentials | ||
| clientId: config.clientId, | ||
|
|
@@ -392,9 +393,14 @@ export class MCPOAuthProvider { | |
| } | ||
|
|
||
| debugLogger.debug('→ Attempting dynamic client registration...'); | ||
| const { metadata: authServerMetadata } = | ||
| const { metadata: authServerMetadata, issuerUrl } = | ||
| await this.discoverAuthServerMetadataForRegistration(config.issuer); | ||
| registrationUrl = authServerMetadata.registration_endpoint; | ||
| if (authServerMetadata) { | ||
| registrationUrl = OAuthUtils.metadataToOAuthConfig( | ||
| authServerMetadata, | ||
| issuerUrl, | ||
| )?.registrationUrl; | ||
| } | ||
| } | ||
|
|
||
| // Register client if registration endpoint is available | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.