Overview
Add conformance tests for OAuth Resource Indicators (RFC 8707) implementation, ensuring clients correctly specify target resources and use canonical server URIs.
Specification References
Key Requirements from Specification
Resource Parameter (MUST)
- Clients MUST implement Resource Indicators per RFC 8707
resource parameter MUST be included in both authorization and token requests
resource parameter MUST identify the MCP server the client intends to use the token with
resource parameter MUST use the canonical URI of the MCP server
- Clients MUST send this parameter regardless of whether authorization servers support it
Canonical Server URI (SHOULD)
- Clients SHOULD provide the most specific URI for the MCP server
- Canonical form uses lowercase scheme and host components
- Implementations SHOULD accept uppercase scheme/host for robustness
Resource Identifier Options
The resource identifier can be either:
- The full MCP request URL (e.g.,
https://mcp.example.com/public/mcp)
- The base URL (e.g.,
https://mcp.example.com)
This aligns with the resource parameter in RFC 9728 and the Protected Resource Metadata discovery requirements.
Valid Canonical URI Examples
https://mcp.example.com/mcp
https://mcp.example.com
https://mcp.example.com:8443
https://mcp.example.com/server/mcp
Invalid Canonical URI Examples
mcp.example.com (missing scheme)
https://mcp.example.com#fragment (contains fragment)
URI Trailing Slash
- Both
https://mcp.example.com/ and https://mcp.example.com are valid
- Implementations SHOULD consistently use form without trailing slash unless semantically significant
Scenarios to Cover
Positive Tests
- Client includes
resource parameter in authorization request
- Client includes
resource parameter in token request
- Client uses correct canonical URI format (full MCP request URL)
- Client uses correct canonical URI format (base URL)
- Client handles URIs with port numbers correctly
- Client handles URIs with path components correctly
- Client normalizes scheme and host to lowercase
Negative Tests
- Client omits
resource parameter from authorization request
- Client omits
resource parameter from token request
- Client uses invalid URI (missing scheme)
- Client uses invalid URI (contains fragment)
- Client uses inconsistent URIs between requests
- Client fails to normalize canonical URI properly
Implementation Notes
- Register spec references in src/scenarios/client/auth/spec-references.ts
- Build on existing auth scenarios in
src/scenarios/client/auth/
- Follow patterns from
basic-dcr.ts and basic-metadata.ts
- Include at least one negative test scenario per requirement
- Test both full URL and base URL as resource identifiers
Acceptance Criteria
Overview
Add conformance tests for OAuth Resource Indicators (RFC 8707) implementation, ensuring clients correctly specify target resources and use canonical server URIs.
Specification References
Key Requirements from Specification
Resource Parameter (MUST)
resourceparameter MUST be included in both authorization and token requestsresourceparameter MUST identify the MCP server the client intends to use the token withresourceparameter MUST use the canonical URI of the MCP serverCanonical Server URI (SHOULD)
Resource Identifier Options
The resource identifier can be either:
https://mcp.example.com/public/mcp)https://mcp.example.com)This aligns with the
resourceparameter in RFC 9728 and the Protected Resource Metadata discovery requirements.Valid Canonical URI Examples
https://mcp.example.com/mcphttps://mcp.example.comhttps://mcp.example.com:8443https://mcp.example.com/server/mcpInvalid Canonical URI Examples
mcp.example.com(missing scheme)https://mcp.example.com#fragment(contains fragment)URI Trailing Slash
https://mcp.example.com/andhttps://mcp.example.comare validScenarios to Cover
Positive Tests
resourceparameter in authorization requestresourceparameter in token requestNegative Tests
resourceparameter from authorization requestresourceparameter from token requestImplementation Notes
src/scenarios/client/auth/basic-dcr.tsandbasic-metadata.tsAcceptance Criteria