Repository navigation
Request: make resource parameter OPTIONAL (RFC 8707-aligned)
#1599
Closed
arcaputo3
started this conversation in
Ideas - Security
Replies: 1 comment
|
Moving this to an issue (#1614) since this is a discussion about a potential spec change. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The MCP authorization spec currently requires clients to always send a
resourceparameter:This contradicts two stated goals of the spec—interoperability and simplicity—and it’s not consistent with RFC 8707. RFC 8707 explicitly makes
resourceoptional:And §2.1 is explicit that omitting
resourceis permitted; servers MAY still process the request (or MAY require it and fail withinvalid_target):The current MCP language therefore turns a MAY into a MUST, which (a) diverges from RFC 8707’s intent and (b) breaks interoperability with major IdPs that don’t accept
resourceat/authorize.Real-world breakage
Microsoft Entra ID (v2) rejects
resourceat/authorizeand is scope-centric; the supported pattern isscope={resource}/.default(functional equivalent of v1resource=...). Developers routinely hitAADSTS901002: The 'resource' request parameter is not supported.([Microsoft Learn]4)(See the MCP Inspector issue demonstrating this failure mode.) ([GitHub]5)
OIDC Core centers consent/audience around
scope, notresource, and never requiresresource. ([OpenID Foundation]6)Also: even when a client does send
resource, RFC 6749 says servers MUST ignore unrecognized request parameters—so relying on universal enforcement is wishful thinking. Audience binding must be validated at the resource server regardless. ([RFC 6749 Section 4.1.2]7)Standards compliance & discovery constraints
The MCP spec’s own standards-compliance goals emphasize interoperability and simplicity. Mandating
resourceacross the board undermines both by forcing non-portable client behavior. ([MCP Authorization Section 1.3]1)RFC 8707's resource parameter is an optional extension. Treating an RFC MAY as a protocol-level MUST is not RFC-aligned. ([IETF Datatracker]3)
No discovery signal exists to tell clients whether an AS supports or requires
resource. Neither OAuth 2.0 AS Metadata (RFC 8414) nor OIDC Discovery define a flag for RFC 8707 support. Providers legitimately differ, and clients can’t learn this from.well-known. ([RFC 8414]11, [OIDC Discovery 1.0]12)Given that reality, the spec should not require
resourceunconditionally.Proposed spec changes (minimal, standards-aligned)
Relax the requirement.
Change “
resourceMUST be included in authorization and token requests” to:This honors RFC 8707’s optional semantics and keeps the security goal.
Define an interoperable fallback.
Add explicit guidance for non-8707 IdPs (e.g., Microsoft Entra v2):
resource; request scopes for a single API..defaultcases): if the AS is Entra v2, usescope={resource}/.default. (Microsoft’s documented bridge from v1resourceto v2 scopes.) ([Microsoft Learn]8)Discovery hint (non-normative).
Because there’s no metadata flag for RFC 8707 support:
resource. (MCP already leans on Protected Resource Metadata, RFC 9728.) ([RFC Editor]9)resourceonce; oninvalid_targetor known provider-specific errors (e.g., AADSTS901002), retry withoutresourceand continue scope-based. ([IETF Datatracker]3)Keep audience checks a MUST.
Regardless of request shape, MCP servers MUST verify that received tokens are audience-restricted to themselves (e.g., via
aud) and MUST reject tokens not issued for them. This matches RFC 8707’s security rationale. ([IETF Datatracker]3)Why this is the right trade-off
resourcewhere it’s actually supported. ([IETF Datatracker]3)References: RFC 8707 (Resource Indicators), RFC 6749 (OAuth 2.0), RFC 8414 (AS Metadata), OIDC Core & Discovery, Microsoft Entra docs on scopes/
.default, MCP Inspector issue, MCP Authorization spec, RFC 9728 (Protected Resource Metadata), IETF Datatracker.All reactions