feat: allow OIDC configuration for OAuth server #585
+32
−3
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.
The MCP authorization spec relies on a specific metadata URL to be published by the authorization server, as described in RFC 8414. There is also a metadata endpoint that's used for OIDC discovery that has very similar information:
https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig
It seems like either could be used for AS metadata, especially since the client could be trying to obtain an identity. I don't want to run afoul of the MCP spec but this seems like it serves the same purpose and would be a good stop-gap in case an identity provider does not publish the OAuth-specific endpoint.
Motivation and Context
I am using Auth0 as an identity provider and they publish the OIDC endpoint:
http://auth0.auth0.com/.well-known/openid-configuration
... but not the OAuth one:
https://auth0.auth0.com/.well-known/oauth-authorization-server
How Has This Been Tested?
npm test
and I ran it locally using this:geelen/mcp-remote#102
Breaking Changes
The
OAuthClientProvider.useOidcProviderConfiguration()
method should probably be a getter but that would make this breaking since you can't have an optional getter in TS. So, no, no breaking changes.Types of changes
Checklist
Additional context
The differences between the OpenID and OAuth metadata are minimal and are mainly things that the OpenID config has that the OAuth one doesn't (for Okta it's the
id_token_signing_alg_values_supported
,jwks_uri
, anduserinfo_endpoint
properties). In other words, the OpenID one can be used as-is. Everything that is required for the OAuth metadata is also required for the OpenID one:issuer
authorization_endpoint
token_endpoint
response_types_supported