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's resource param
- MCP SDK should support Azure as an AS, as Azure is extremely commonly used, particularly in enterprise.
PKCE Not Advertised
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's aud claim.
- Azure v2 endpoints do not implement RFC 8707. They implement a very similar
scope parameter in place of the resource param
scope 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 of resource 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
- 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.
Support Azure for Enterprise Adoption
scopeparam instead of RFC 8707'sresourceparamPKCE Not Advertised
code_challenge_methods_supportedfield lists the PKCE methods supported by the AS. According to RFC8414 "If omitted, the authorization server does not support PKCE."code_challenge_methods_supported, but does support PKCE with methodS256scopeinstead ofresourceresourceparam that indicates which protected resource the client is requesting access to./authorizeand/tokenendpoints, and in the JWT'saudclaim.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.resourceis provided (i.e. It does not ignore/silently drop it)scopein place ofresourcewith the required minor change to value.Other Related Azure Issues
/.well-known/openid-configurationrather than/.well-known/oauth-authorization-serverintroduced in RFC 8414This commit has one implementation of the compatibility changes needed to support Azure as AS.