Search in sources :

Example 11 with ClientCredentialsAccessTokenProvider

use of org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsAccessTokenProvider in project vorto by eclipse.

the class TokenUtils method accessTokenProvider.

public static AccessTokenProvider accessTokenProvider() {
    AuthorizationCodeAccessTokenProvider authorizationCodeAccessTokenProvider = new AuthorizationCodeAccessTokenProvider();
    authorizationCodeAccessTokenProvider.setStateKeyGenerator(new CustomStateKeyGenerator());
    ImplicitAccessTokenProvider implicitAccessTokenProvider = new ImplicitAccessTokenProvider();
    return new AccessTokenProviderChain(Arrays.<AccessTokenProvider>asList(authorizationCodeAccessTokenProvider, implicitAccessTokenProvider, new ResourceOwnerPasswordAccessTokenProvider(), new ClientCredentialsAccessTokenProvider()));
}
Also used : AuthorizationCodeAccessTokenProvider(org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeAccessTokenProvider) ImplicitAccessTokenProvider(org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider) AccessTokenProviderChain(org.springframework.security.oauth2.client.token.AccessTokenProviderChain) ClientCredentialsAccessTokenProvider(org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsAccessTokenProvider) ResourceOwnerPasswordAccessTokenProvider(org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider)

Aggregations

ClientCredentialsAccessTokenProvider (org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsAccessTokenProvider)11 AccessTokenProviderChain (org.springframework.security.oauth2.client.token.AccessTokenProviderChain)6 ImplicitAccessTokenProvider (org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider)6 ResourceOwnerPasswordAccessTokenProvider (org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider)6 Test (org.junit.Test)5 AuthorizationCodeAccessTokenProvider (org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeAccessTokenProvider)5 ClientHttpResponse (org.springframework.http.client.ClientHttpResponse)4 DefaultResponseErrorHandler (org.springframework.web.client.DefaultResponseErrorHandler)4 ResponseErrorHandler (org.springframework.web.client.ResponseErrorHandler)4 IOException (java.io.IOException)3 OAuth2ContextConfiguration (org.springframework.security.oauth2.client.test.OAuth2ContextConfiguration)3 DebugRestTemplateInterceptor (gov.ca.cwds.config.logging.DebugRestTemplateInterceptor)2 OAuth2RestTemplate (org.springframework.security.oauth2.client.OAuth2RestTemplate)2 AccessTokenProvider (org.springframework.security.oauth2.client.token.AccessTokenProvider)2 Field (java.lang.reflect.Field)1 List (java.util.List)1 ClientHttpRequestFactory (org.springframework.http.client.ClientHttpRequestFactory)1 HttpComponentsClientHttpRequestFactory (org.springframework.http.client.HttpComponentsClientHttpRequestFactory)1 DefaultOAuth2ClientContext (org.springframework.security.oauth2.client.DefaultOAuth2ClientContext)1 DefaultAccessTokenRequest (org.springframework.security.oauth2.client.token.DefaultAccessTokenRequest)1