SOLR-18073 JWT Authentication plugin now supports matching non-string claims#4049
Merged
janhoy merged 1 commit intoapache:mainfrom Feb 4, 2026
Merged
Conversation
… claims such as boolean
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the JWT Authentication plugin where non-string claims (such as boolean values) could not be matched during authentication. The fix converts claim values to strings before pattern matching, enabling support for boolean and other non-string claim types as specified in the OIDC specification.
Changes:
- Modified claim matching logic to handle non-string claim values by converting them to strings
- Added test coverage for boolean claim matching scenarios
- Added changelog entry documenting the bug fix
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| solr/modules/jwt-auth/src/java/org/apache/solr/security/jwt/JWTAuthPlugin.java | Changed from getStringClaimValue() to getClaimValue() with String.valueOf() conversion to support non-string claims |
| solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTAuthPluginTest.java | Added boolean claims to test data and comprehensive test method for boolean claim matching |
| changelog/unreleased/SOLR-18073-jwt-bool-claims.yml | Added changelog entry for the bug fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
epugh
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-18073
Thanks to Tony Panza for bug report with failing unit test