Skip to content

Commit 8c63c7d

Browse files
committed
Merge branch '1.0.x'
2 parents 2a69bcf + e134b77 commit 8c63c7d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2RefreshTokenAuthenticationProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2022 the original author or authors.
2+
* Copyright 2020-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -111,7 +111,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
111111
}
112112

113113
if (!registeredClient.getId().equals(authorization.getRegisteredClientId())) {
114-
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_CLIENT);
114+
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_GRANT);
115115
}
116116

117117
if (!registeredClient.getAuthorizationGrantTypes().contains(AuthorizationGrantType.REFRESH_TOKEN)) {

oauth2-authorization-server/src/test/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2RefreshTokenAuthenticationProviderTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2022 the original author or authors.
2+
* Copyright 2020-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -400,7 +400,7 @@ public void authenticateWhenRefreshTokenIssuedToAnotherClientThenThrowOAuth2Auth
400400
.isInstanceOf(OAuth2AuthenticationException.class)
401401
.extracting(ex -> ((OAuth2AuthenticationException) ex).getError())
402402
.extracting("errorCode")
403-
.isEqualTo(OAuth2ErrorCodes.INVALID_CLIENT);
403+
.isEqualTo(OAuth2ErrorCodes.INVALID_GRANT);
404404
}
405405

406406
@Test

0 commit comments

Comments
 (0)