Skip to content

Commit

Permalink
Polish JwtValidators
Browse files Browse the repository at this point in the history
Closes gh-14831
  • Loading branch information
jzheaux committed Apr 2, 2024
1 parent ff19f04 commit ee42ad2
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ private JwtValidators() {
* supplied
*/
public static OAuth2TokenValidator<Jwt> createDefaultWithIssuer(String issuer) {
List<OAuth2TokenValidator<Jwt>> validators = new ArrayList<>();
validators.add(new JwtTimestampValidator());
validators.add(new JwtIssuerValidator(issuer));
return new DelegatingOAuth2TokenValidator<>(validators);
return createDefaultWithValidators(new JwtIssuerValidator(issuer));
}

/**
Expand Down Expand Up @@ -90,7 +87,7 @@ public static OAuth2TokenValidator<Jwt> createDefaultWithValidators(List<OAuth2T
JwtTimestampValidator jwtTimestampValidator = CollectionUtils.findValueOfType(tokenValidators,
JwtTimestampValidator.class);
if (jwtTimestampValidator == null) {
tokenValidators.add(new JwtTimestampValidator());
tokenValidators.add(0, new JwtTimestampValidator());
}
return new DelegatingOAuth2TokenValidator<>(tokenValidators);
}
Expand Down

0 comments on commit ee42ad2

Please sign in to comment.