Skip to content

Commit

Permalink
Do not fail when expected audience is null (helidon-io#4160)
Browse files Browse the repository at this point in the history
Do not fail when expected audience is null

Signed-off-by: David Kral <david.k.kral@oracle.com>
(cherry picked from commit 525736c)
  • Loading branch information
Verdent committed May 4, 2022
1 parent b0c1d0d commit b43be8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/jwt/src/main/java/io/helidon/security/jwt/Jwt.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public static void addIssuerValidator(Collection<Validator<Jwt>> validators, Str
* Add validator of audience to the collection of validators.
*
* @param validators collection of validators
* @param audience audience expected to be in the token
* @param audience audience expected to be in the token, never null
* @param mandatory whether the audience field is mandatory in the token
*/
public static void addAudienceValidator(Collection<Validator<Jwt>> validators, String audience, boolean mandatory) {
Expand Down Expand Up @@ -917,7 +917,7 @@ public Errors validate(List<Validator<Jwt>> validators) {
* @return errors instance to check for validation result
*/
public Errors validate(String issuer, String audience) {
return validate(issuer, Set.of(audience));
return validate(issuer, audience == null ? Set.of() : Set.of(audience));
}

/**
Expand Down

0 comments on commit b43be8f

Please sign in to comment.