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

Handle missing expected array claim #393

Merged
merged 2 commits into from
Feb 14, 2020
Merged

Conversation

lbalmaceda
Copy link
Contributor

Changes

If an expectation was set with the JWTVerifier.Builder#withArrayClaim method, once a token was attempted to be verified and if it didn't include the given claim, the code would throw an unhandled NPE.

This change makes it throw the InvalidClaimException that is thrown on this very same scenario for the rest of the claims, stating that the claim doesn't match the expected value.

There are a few whitespace changes that can be ignored.

References

Resolves #384

Testing

  • This change adds test coverage
  • This change has been tested on the latest version of Java or why not

Checklist

@lbalmaceda lbalmaceda added the small This PR may require low effort to action, or contains few changes to review label Feb 14, 2020
@lbalmaceda lbalmaceda requested a review from a team February 14, 2020 20:11
@lbalmaceda lbalmaceda added this to the v3-Next milestone Feb 14, 2020
@lbalmaceda lbalmaceda merged commit 8e02a2e into master Feb 14, 2020
@lbalmaceda lbalmaceda modified the milestones: v3-Next, 3.10.0 Feb 14, 2020
@jimmyjames jimmyjames deleted the fix-arr-claim-presence-check branch March 17, 2022 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Fixed small This PR may require low effort to action, or contains few changes to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException when the claim doesn't exist in the token
2 participants