Class OAuth2Configuration
java.lang.Object
org.alfresco.rest.sdk.feign.config.OAuth2Configuration
@Configuration
@EnableConfigurationProperties(org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientProperties.class)
@ConditionalOnProperty("spring.security.oauth2.client.registration.alfresco-rest-api.provider")
public class OAuth2Configuration
extends Object
Configuration for OAuth2 authentication flows. It configures a
OAuth2FeignRequestInterceptor that retrieves the access token and generates the
authorization header with the bearer. This is based in the OAuth2 support provided by the Spring Security module. So, the configuration must be done using
the corresponding properties. The configuration of the client must be done using the properties
spring.security.oauth2.client.registration.alfresco-rest-api.xxxx.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.client.OAuth2AuthorizedClientManagerauthorizedClientManager(org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository, org.springframework.security.oauth2.client.OAuth2AuthorizedClientService authorizedClientService, org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider oAuth2AuthorizedClientProvider) org.springframework.security.oauth2.client.InMemoryOAuth2AuthorizedClientServiceauthorizedClientService(org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository) org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepositoryclientRegistrationRepository(org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientProperties properties) org.springframework.security.oauth2.client.OAuth2AuthorizedClientProviderorg.springframework.security.oauth2.client.OAuth2AuthorizeRequestrequestInterceptor(org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager authorizedClientManager, org.springframework.security.oauth2.client.OAuth2AuthorizeRequest oAuth2AuthorizeRequest, org.springframework.security.oauth2.client.InMemoryOAuth2AuthorizedClientService authorizedClientService)
-
Constructor Details
-
OAuth2Configuration
public OAuth2Configuration()
-
-
Method Details
-
clientRegistrationRepository
@Bean @ConditionalOnMissingBean(org.springframework.security.oauth2.client.registration.ClientRegistrationRepository.class) public org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository clientRegistrationRepository(org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientProperties properties) -
authorizedClientService
@Bean @ConditionalOnMissingBean(org.springframework.security.oauth2.client.OAuth2AuthorizedClientService.class) public org.springframework.security.oauth2.client.InMemoryOAuth2AuthorizedClientService authorizedClientService(org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository) -
oAuth2AuthorizedClientProvider
@Bean @ConditionalOnMissingBean public org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider oAuth2AuthorizedClientProvider() -
authorizedClientManager
@Bean public org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager authorizedClientManager(org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository, org.springframework.security.oauth2.client.OAuth2AuthorizedClientService authorizedClientService, org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider oAuth2AuthorizedClientProvider) -
oAuth2AuthorizeRequest
@Bean public org.springframework.security.oauth2.client.OAuth2AuthorizeRequest oAuth2AuthorizeRequest() -
requestInterceptor
@Bean public OAuth2FeignRequestInterceptor requestInterceptor(org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager authorizedClientManager, org.springframework.security.oauth2.client.OAuth2AuthorizeRequest oAuth2AuthorizeRequest, org.springframework.security.oauth2.client.InMemoryOAuth2AuthorizedClientService authorizedClientService)
-