Skip to content

Authorization server: check code_challenge_methods_supported in the OpenID Connect Discovery document #612

Backlog

Description

@Tetsurohhori

Summary

authorization-server-metadata-endpoint stops at the first well-known URL that returns 200. If a server publishes both RFC 8414 metadata and an OpenID Connect Discovery document, the second one is never checked. It can omit code_challenge_methods_supported and the server still passes. I'd like to agree on the scope of a check inside that scenario before anyone writes code. This is the separate change mentioned in #578.

Requirement

MCP 2025-11-25 and 2026-07-28, "Authorization Code Protection":

Authorization servers providing OpenID Connect Discovery 1.0 MUST include code_challenge_methods_supported in their metadata to ensure MCP compatibility.

The same section says MCP clients MUST refuse to proceed if the field is missing from the provider metadata. So a client that uses the discovery document would stop, although the server passes the scenario.

Proposed check: openid-configuration-pkce

After the current check, request the OpenID Connect Discovery URLs that the scenario already builds, even if the RFC 8414 URL answered. No login is needed.

Result of the requests Result
a discovery document is served, with the field SUCCESS
a discovery document is served, without the field FAILURE
no discovery document is served SKIPPED, because OpenID Connect Discovery is optional when RFC 8414 metadata is served

If both path forms are served, each document would be checked. The quoted rule only requires the field to be present, so this check wouldn't require a particular value. The existing check already requires S256 in the document it reads.

Evidence

In a small Python server of mine, I removed the field from the discovery document only. None of the results changed in the metadata and code-grant scenarios, which I had transcribed to Python from 96a6f94. A probe that reads the discovery document tells the two servers apart (record). That probe also requires S256, which is stricter than the check proposed here. This isn't a run of this harness or of a real SDK.

Questions

  1. Is a separate check id right, or should this be part of authorization-server-metadata?
  2. What should count as a served document? I'd suggest a 200 response whose JSON issuer equals the server URL, so that a catch-all page doesn't count. A discovery document with the wrong issuer would then need its own result.
  3. Should the check apply from 2025-11-25? I only read the 2025-11-25 and 2026-07-28 texts for this rule.

Disclosure: drafted with AI assistance (Claude). I ran the Python comparison myself and checked the quotes against the MCP text.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions