Skip to content

Commit ee42ad2

Browse files
committed
Polish JwtValidators
Closes gh-14831
1 parent ff19f04 commit ee42ad2

File tree

1 file changed

+2
-5
lines changed
  • oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt

1 file changed

+2
-5
lines changed

oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtValidators.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ private JwtValidators() {
5252
* supplied
5353
*/
5454
public static OAuth2TokenValidator<Jwt> createDefaultWithIssuer(String issuer) {
55-
List<OAuth2TokenValidator<Jwt>> validators = new ArrayList<>();
56-
validators.add(new JwtTimestampValidator());
57-
validators.add(new JwtIssuerValidator(issuer));
58-
return new DelegatingOAuth2TokenValidator<>(validators);
55+
return createDefaultWithValidators(new JwtIssuerValidator(issuer));
5956
}
6057

6158
/**
@@ -90,7 +87,7 @@ public static OAuth2TokenValidator<Jwt> createDefaultWithValidators(List<OAuth2T
9087
JwtTimestampValidator jwtTimestampValidator = CollectionUtils.findValueOfType(tokenValidators,
9188
JwtTimestampValidator.class);
9289
if (jwtTimestampValidator == null) {
93-
tokenValidators.add(new JwtTimestampValidator());
90+
tokenValidators.add(0, new JwtTimestampValidator());
9491
}
9592
return new DelegatingOAuth2TokenValidator<>(tokenValidators);
9693
}

0 commit comments

Comments
 (0)