Polish JwtValidators

Closes gh-14831
This commit is contained in:
Josh Cummings 2024-04-02 16:04:43 -06:00
parent ff19f04fca
commit ee42ad2c8c
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
1 changed files with 2 additions and 5 deletions

View File

@ -52,10 +52,7 @@ public final class 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));
}
/**
@ -90,7 +87,7 @@ public final class JwtValidators {
JwtTimestampValidator jwtTimestampValidator = CollectionUtils.findValueOfType(tokenValidators,
JwtTimestampValidator.class);
if (jwtTimestampValidator == null) {
tokenValidators.add(new JwtTimestampValidator());
tokenValidators.add(0, new JwtTimestampValidator());
}
return new DelegatingOAuth2TokenValidator<>(tokenValidators);
}