Skip to content

Conversation

LucaButBoring
Copy link
Contributor

@LucaButBoring LucaButBoring commented Oct 1, 2025

  • Removes duplicated upfront code challenge method validation for OIDC metadata
  • Defaults to S256 code challenge if code_challenge_methods_supported is not present in AS metadata

Motivation and Context

This change makes metadata validation slightly more flexible by assuming S256 is supported as a code challenge method if the code_challenge_methods_supported field is not provided in AS metadata. This is the case for both Azure AD and Cognito, despite both supporting it.

This is caused by a point of ambiguity in RFC 8414 in which OIDC metadata is supported as valid OAuth metadata, but existing OIDC-specific clients (with strict validation) do not understand the union of OAuth and OIDC metadata and will reject it. This poses challenges for integration with OIDC authorization servers that cannot trivially add support for this on existing metadata documents, but nevertheless support S256 in practice.

If code_challenge_methods_supported is present, validation happens in the same manner as today, rejecting documents that do not declare support for S256.

How Has This Been Tested?

Adjusted unit tests and validated against a custom server using simpleOAuthClient.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

#832

Copy link
Member

@pcarleton pcarleton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pcarleton pcarleton merged commit 59cb504 into modelcontextprotocol:main Oct 7, 2025
2 checks passed
@LucaButBoring LucaButBoring deleted the chore/permissive-code-challenge-method branch October 7, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants