Skip to content

Commit 2e07ce8

Browse files
committed
Polish gh-738
1 parent 61621c5 commit 2e07ce8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
8888
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.UNAUTHORIZED_CLIENT);
8989
}
9090

91-
Set<String> authorizedScopes = Collections.EMPTY_SET; // Empty by default
91+
Set<String> authorizedScopes = Collections.emptySet();
9292
if (!CollectionUtils.isEmpty(clientCredentialsAuthentication.getScopes())) {
9393
for (String requestedScope : clientCredentialsAuthentication.getScopes()) {
9494
if (!registeredClient.getScopes().contains(requestedScope)) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public void authenticateWhenScopeRequestedThenAccessTokenContainsScope() {
212212
}
213213

214214
@Test
215-
public void authenticateWhenNoScopeRequestedThenAccessTokenNotContainsAnyScope() {
215+
public void authenticateWhenNoScopeRequestedThenAccessTokenDoesNotContainScope() {
216216
RegisteredClient registeredClient = TestRegisteredClients.registeredClient2().build();
217217
OAuth2ClientAuthenticationToken clientPrincipal = new OAuth2ClientAuthenticationToken(
218218
registeredClient, ClientAuthenticationMethod.CLIENT_SECRET_BASIC, registeredClient.getClientSecret());

0 commit comments

Comments
 (0)