Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when calling jwtClaimsSet.getClaims() #335

Open
hantsy opened this issue Oct 2, 2022 · 1 comment
Open

NPE when calling jwtClaimsSet.getClaims() #335

hantsy opened this issue Oct 2, 2022 · 1 comment

Comments

@hantsy
Copy link

hantsy commented Oct 2, 2022

When trying to get auth0, I clone this project and add some debug info the following piece in the https://github.com/eclipse-ee4j/soteria/blob/master/impl/src/main/java/org/glassfish/soteria/mechanisms/openid/domain/AccessTokenImpl.java#L63, the jwtClaimsSet.getClaims()is possible when tokenJWT is a EncryptedJWT.

try {
    this.tokenJWT = JWTParser.parse(token);
    jwtClaimsSet = tokenJWT.getJWTClaimsSet();
    this.claims = jwtClaimsSet.getClaims();
} catch (ParseException ex) {
    // Access token doesn't need to be JWT at all
}
@arrenping
Copy link

I found in the original source from Payara there should be a null check

this.claims = jwtClaimsSet == null ? null : jwtClaimsSet.getClaims();

https://github.com/payara/ecosystem-security-connectors/blob/73c4436fddd581b6f64d83c2f03dbba188006a72/openid/src/main/java/fish/payara/security/openid/domain/AccessTokenImpl.java#L90

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

No branches or pull requests

2 participants