-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
scope
param instead of RFC 8707'sresource
param
- 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_supported
field 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
resource
param that indicates which protected resource the client is requesting access to.- This is included in
/authorize
and/token
endpoints, and in the JWT'saud
claim.
- This is included in
- Azure v2 endpoints do not implement RFC 8707. They implement a very similar
scope
parameter in place of theresource
paramscope
is 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
resource
is provided (i.e. It does not ignore/silently drop it) - To support Azure, conditional logic is needed to provide
scope
in place ofresource
with the required minor change to value.
Other Related Azure Issues
- Azure AS metadata endpoint is at
/.well-known/openid-configuration
rather than/.well-known/oauth-authorization-server
introduced 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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request