auth0 / java-jwt

Java implementation of JSON Web Token (JWT)
MIT License
5.84k stars 921 forks source link

empty expected audience array should throw InvalidClaimException #679

Closed jimmyjames closed 9 months ago

jimmyjames commented 9 months ago

Changes

Currently, validating a JWT expecting an empty string array fails with a NPE, instead of an InvalidClaimException, as discussed in #674. This change fixes that.

It also includes a small refactor to the audience validation logic, replacing the terse conditional with clearer and more extendable logic. That change was done in a commit prior to making any logic changes to ensure no unintended changes.

Fixes #674.