|
|
|
@ -19,6 +19,7 @@ import org.junit.Before; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.Test; |
|
|
|
import org.mockito.ArgumentCaptor; |
|
|
|
import org.mockito.ArgumentCaptor; |
|
|
|
import org.springframework.security.authentication.TestingAuthenticationToken; |
|
|
|
import org.springframework.security.authentication.TestingAuthenticationToken; |
|
|
|
|
|
|
|
import org.springframework.security.oauth2.core.AuthorizationGrantType; |
|
|
|
import org.springframework.security.oauth2.core.ClientAuthenticationMethod; |
|
|
|
import org.springframework.security.oauth2.core.ClientAuthenticationMethod; |
|
|
|
import org.springframework.security.oauth2.core.OAuth2AuthenticationException; |
|
|
|
import org.springframework.security.oauth2.core.OAuth2AuthenticationException; |
|
|
|
import org.springframework.security.oauth2.core.OAuth2ErrorCodes; |
|
|
|
import org.springframework.security.oauth2.core.OAuth2ErrorCodes; |
|
|
|
@ -292,9 +293,9 @@ public class OAuth2AuthorizationCodeAuthenticationProviderTests { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void authenticateWhenRefreshTokenDisabledThenRefreshTokenNull() { |
|
|
|
public void authenticateWhenRefreshTokenGrantNotConfiguredThenRefreshTokenNotIssued() { |
|
|
|
RegisteredClient registeredClient = TestRegisteredClients.registeredClient() |
|
|
|
RegisteredClient registeredClient = TestRegisteredClients.registeredClient() |
|
|
|
.tokenSettings(tokenSettings -> tokenSettings.enableRefreshTokens(false)) |
|
|
|
.authorizationGrantTypes(grantTypes -> grantTypes.remove(AuthorizationGrantType.REFRESH_TOKEN)) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
OAuth2Authorization authorization = TestOAuth2Authorizations.authorization(registeredClient).build(); |
|
|
|
OAuth2Authorization authorization = TestOAuth2Authorizations.authorization(registeredClient).build(); |
|
|
|
|