File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
main/java/org/springframework/security/oauth2/jwt
test/java/org/springframework/security/oauth2/jwt Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public OAuth2TokenValidatorResult validate(Jwt jwt) {
9595 private OAuth2Error createOAuth2Error (String reason ) {
9696 logger .debug (reason );
9797 return new OAuth2Error (
98- OAuth2ErrorCodes .INVALID_REQUEST ,
98+ OAuth2ErrorCodes .INVALID_TOKEN ,
9999 reason ,
100100 "https://tools.ietf.org/html/rfc6750#section-3.1" );
101101 }
Original file line number Diff line number Diff line change 2727import org .junit .Test ;
2828
2929import org .springframework .security .oauth2 .core .OAuth2Error ;
30+ import org .springframework .security .oauth2 .core .OAuth2ErrorCodes ;
3031import org .springframework .security .oauth2 .core .OAuth2TokenValidatorResult ;
3132import org .springframework .security .oauth2 .jose .jws .JwsAlgorithms ;
3233
@@ -109,6 +110,7 @@ public void validateWhenConfiguredWithClockSkewThenValidatesUsingThatSkew() {
109110 result .getErrors ().stream ().map (OAuth2Error ::getDescription ).collect (Collectors .toList ());
110111
111112 assertThat (result .hasErrors ()).isTrue ();
113+ assertThat (result .getErrors ().iterator ().next ().getErrorCode ()).isEqualTo (OAuth2ErrorCodes .INVALID_TOKEN );
112114 assertThat (messages ).contains ("Jwt used before " + justOverOneDayFromNow );
113115
114116 }
You can’t perform that action at this time.
0 commit comments