Search in sources :

Example 6 with ResourceServerTokenServices

use of org.springframework.security.oauth2.provider.token.ResourceServerTokenServices in project coffeenet-starter by coffeenet.

the class CoffeeNetApiTokenAccessFilter method oauthAuthenticationManager.

private AuthenticationManager oauthAuthenticationManager(ResourceServerTokenServices tokenServices) {
    OAuth2AuthenticationManager oauthAuthenticationManager = new OAuth2AuthenticationManager();
    oauthAuthenticationManager.setResourceId(resourceServerProperties.getResourceId());
    oauthAuthenticationManager.setTokenServices(tokenServices);
    oauthAuthenticationManager.setClientDetailsService(null);
    return oauthAuthenticationManager;
}
Also used : OAuth2AuthenticationManager(org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationManager)

Aggregations

ResourceServerTokenServices (org.springframework.security.oauth2.provider.token.ResourceServerTokenServices)3 UserInfoRestTemplateFactory (org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoRestTemplateFactory)1 AnonymousAuthenticationProvider (org.springframework.security.authentication.AnonymousAuthenticationProvider)1 OAuth2RestOperations (org.springframework.security.oauth2.client.OAuth2RestOperations)1 OAuth2ClientAuthenticationProcessingFilter (org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter)1 OAuth2AccessDeniedException (org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException)1 InvalidTokenException (org.springframework.security.oauth2.common.exceptions.InvalidTokenException)1 ResourceServerSecurityConfigurer (org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer)1 OAuth2Authentication (org.springframework.security.oauth2.provider.OAuth2Authentication)1 OAuth2AuthenticationManager (org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationManager)1 DefaultTokenServices (org.springframework.security.oauth2.provider.token.DefaultTokenServices)1