Skip to content

Fix/extra claim validation/non string claims#969

Open
priyanshi-singh-22 wants to merge 3 commits intomodelcontextprotocol:mainfrom
Evernorth:fix/extra-claim-validation/non-string-claims
Open

Fix/extra claim validation/non string claims#969
priyanshi-singh-22 wants to merge 3 commits intomodelcontextprotocol:mainfrom
Evernorth:fix/extra-claim-validation/non-string-claims

Conversation

@priyanshi-singh-22
Copy link

@priyanshi-singh-22 priyanshi-singh-22 commented Feb 17, 2026

Motivation and Context

This update fixes an issue in OIDC token validation where the validateExtraClaims function used basic string comparisons for claim values. This approach caused validation to fail for non-string claim types such as arrays or lists that are commonly used in OIDC tokens.

How Has This Been Tested?

Test cases in [oidc_test.go] covering various claim value types:

  • String vs string comparison
  • Array vs array comparison
  • Scalar vs array comparison (both directions)
  • Single-element array normalization

Breaking Changes

No breaking changes. This is a backward-compatible enhancement:

  • Existing configurations with simple string claims continue to work unchanged
  • The new logic gracefully handles complex claim types that previously failed
  • No changes to the configuration format or API endpoints

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

  • Enhanced the validateExtraClaims method to handle type-aware comparisons
  • Added support for array-to-array claim validation (checking for overlapping values)
  • Implemented array-to-scalar normalization for single-element arrays

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.

1 participant

Comments