Fix NullPointerException bugs in JWT Authorization Grant validators#1467
Draft
Copilot wants to merge 5 commits intoISSUE-43971-IDJAGReceiverfrom
Draft
Fix NullPointerException bugs in JWT Authorization Grant validators#1467Copilot wants to merge 5 commits intoISSUE-43971-IDJAGReceiverfrom
Copilot wants to merge 5 commits intoISSUE-43971-IDJAGReceiverfrom
Conversation
…ck access token working as as a part of token endpoint Signed-off-by: Yutaka Obuchi <yutaka.obuchi.sd@hitachi.com>
- Add null check for getOtherClaims() map before accessing - Add null check for client_id claim before validation - Provide clear error messages for missing client_id claim Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
- Distinguish between missing claims map and missing client_id claim - More descriptive error message for missing client_id claim Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
- Move getIssuer() and getSubject() calls after clientAssertionState initialization - Add null checks for JWT expiration comparison to prevent NPE - Add comment explaining the initialization order requirement Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review and fix bugs in branch
Fix NullPointerException bugs in JWT Authorization Grant validators
Feb 19, 2026
Collaborator
|
@bucchi Hello, I asked github copilot coding agent to review the branch and suggest codes to fix potential bugs if exist. It is the trial of using the agent, so you need not to follow the code suggestion. |
055b308 to
37a541e
Compare
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.
Description
Code review of the ID-JAG JWT Authorization Grant implementation revealed 5 critical NPE bugs in validator initialization and claim access patterns.
Issues Fixed
IDJWTAuthorizationGrantValidator.java
getOtherClaims()accessed without null check → NPE when claims map missingclient_idclaim accessed without null check → NPE when claim absentJWTAuthorizationGrantType.java
getIssuer()andgetSubject()called beforeclientAssertionStateinitialization when using custom validators:Moved event detail calls after state initialization.
Expiration comparison with nullable
Longvalues → NPE:Impact
Prevents NPEs in:
client_idin OtherClaimsWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
repo.gradle.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/keycloak/keycloak org.codehaus.plexus.classworlds.launcher.Launcher clean compile -pl services -am -DskipTests(dns block)repository.jboss.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/keycloak/keycloak org.codehaus.plexus.classworlds.launcher.Launcher clean compile -pl services -am -DskipTests(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/keycloak/keycloak org.codehaus.plexus.classworlds.launcher.Launcher test -pl tests/base -Dtest=IDJWTAuthorizationGrantTest -am(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.8/af622e91/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/keycloak/keycloak org.codehaus.plexus.classworlds.launcher.Launcher install -DskipTests -pl services -am(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.