Class SynchronizedDelegatingOAuth2AuthorizedClientManager
java.lang.Object
com.broadleafcommerce.cartoperation.oauth2.client.web.SynchronizedDelegatingOAuth2AuthorizedClientManager
- All Implemented Interfaces:
- org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager
public class SynchronizedDelegatingOAuth2AuthorizedClientManager
extends Object
implements org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager
This component implements 
OAuth2AuthorizedClientManager and internally instantiates and
 delegates to AuthorizedClientServiceOAuth2AuthorizedClientManager.
 The only difference between this and AuthorizedClientServiceOAuth2AuthorizedClientManager
 is that this attempts to serialize on the
 OAuth2AuthorizeRequest.getClientRegistrationId(). The reason is that these clients are
 normally shared clients, with shared access tokens. As a result, only one thread needs to call
 the auth server when the token is unavailable or otherwise expired. The token is then stored in
 InMemoryOAuth2AuthorizedClientService for re-use across threads.
 This helps prevent a race condition where multiple threads are trying to fetch the same token at
 the same time via a network call.- Author:
- Kelly Tisdell (ktisdell)
- 
Constructor SummaryConstructorsConstructorDescriptionSynchronizedDelegatingOAuth2AuthorizedClientManager(org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository) 
- 
Method SummaryModifier and TypeMethodDescriptionorg.springframework.security.oauth2.client.OAuth2AuthorizedClientauthorize(org.springframework.security.oauth2.client.OAuth2AuthorizeRequest authorizeRequest) voidsetAuthorizationFailureHandler(org.springframework.security.oauth2.client.OAuth2AuthorizationFailureHandler authorizationFailureHandler) voidsetAuthorizationSuccessHandler(org.springframework.security.oauth2.client.OAuth2AuthorizationSuccessHandler authorizationSuccessHandler) voidsetAuthorizedClientProvider(org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider authorizedClientProvider) voidsetContextAttributesMapper(Function<org.springframework.security.oauth2.client.OAuth2AuthorizeRequest, Map<String, Object>> contextAttributesMapper) 
- 
Constructor Details- 
SynchronizedDelegatingOAuth2AuthorizedClientManagerpublic SynchronizedDelegatingOAuth2AuthorizedClientManager(org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository) 
 
- 
- 
Method Details- 
authorizepublic org.springframework.security.oauth2.client.OAuth2AuthorizedClient authorize(org.springframework.security.oauth2.client.OAuth2AuthorizeRequest authorizeRequest) - Specified by:
- authorizein interface- org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager
 
- 
setAuthorizedClientProviderpublic void setAuthorizedClientProvider(org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider authorizedClientProvider) - See Also:
- 
- AuthorizedClientServiceOAuth2AuthorizedClientManager.setAuthorizedClientProvider(OAuth2AuthorizedClientProvider)
 
 
- 
setContextAttributesMapperpublic void setContextAttributesMapper(Function<org.springframework.security.oauth2.client.OAuth2AuthorizeRequest, Map<String, Object>> contextAttributesMapper) - See Also:
- 
- AuthorizedClientServiceOAuth2AuthorizedClientManager.setContextAttributesMapper(Function)
 
 
- 
setAuthorizationSuccessHandlerpublic void setAuthorizationSuccessHandler(org.springframework.security.oauth2.client.OAuth2AuthorizationSuccessHandler authorizationSuccessHandler) - See Also:
- 
- AuthorizedClientServiceOAuth2AuthorizedClientManager.setAuthorizationSuccessHandler(OAuth2AuthorizationSuccessHandler)
 
 
- 
setAuthorizationFailureHandlerpublic void setAuthorizationFailureHandler(org.springframework.security.oauth2.client.OAuth2AuthorizationFailureHandler authorizationFailureHandler) - See Also:
- 
- AuthorizedClientServiceOAuth2AuthorizedClientManager.setAuthorizationFailureHandler(OAuth2AuthorizationFailureHandler)
 
 
 
-