-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Support Azure for Enterprise Adoption
- With MCP SDK, Azure AD cannot be used as the Authorisation Server (AS) as Azure:
- Does not advertise PKCE in AS metadata
- Uses
scopeparam instead of RFC 8707'sresourceparam
- MCP SDK should support Azure as an AS, as Azure is extremely commonly used, particularly in enterprise.
PKCE Not Advertised
- MCP spec mandates implementation of RFC 8414 - OAuth 2.0 Authorization Server Metadata, and Azure supports the metadata endpoint
- The
code_challenge_methods_supportedfield lists the PKCE methods supported by the AS. According to RFC8414 "If omitted, the authorization server does not support PKCE." - Azure AS omits
code_challenge_methods_supported, but does support PKCE with methodS256 - This one is on Azure and It's a known issue for years. To support Azure, a bypass is needed that ignores the field omission and assumes PKCE is supported, specifically for Azure.
- Bug already raised - Azure OIDC discovery metadata missing code_challenge_methods_supported breaks S256 PKCE validation #832
- According to RFC 8414, this is actually an Azure bug
scope instead of resource
- RFC 8707 - Resource Indicators for OAuth 2.0 is an optional extension to OAuth, that MCP has as mandatory.
- It introduces the
resourceparam that indicates which protected resource the client is requesting access to.- This is included in
/authorizeand/tokenendpoints, and in the JWT'saudclaim.
- This is included in
- Azure v2 endpoints do not implement RFC 8707. They implement a very similar
scopeparameter in place of theresourceparamscopeis a superset, and includes both the "resource" access is being requested to, and the actions ("scopes") to perform on it.
- Azure AS will fail if
resourceis provided (i.e. It does not ignore/silently drop it) - To support Azure, conditional logic is needed to provide
scopein place ofresourcewith the required minor change to value.
Other Related Azure Issues
- Azure AS metadata endpoint is at
/.well-known/openid-configurationrather than/.well-known/oauth-authorization-serverintroduced in RFC 8414- This is somewhat common and mentioned in the RFC
- This SDK added proper support for this with feat: support oidc discovery in client sdk #652
- Azure doesn't support RFC 7591 - OAuth 2.0 Dynamic Client Registration (DCR), however this is only recommended (i.e. not mandated) by spec and this SDK supports static client ID.
This commit has one implementation of the compatibility changes needed to support Azure as AS.
kamranayub
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request