Class DelegatingOAuth2AuthorizedClientProvider
- java.lang.Object
-
- org.springframework.security.oauth2.client.DelegatingOAuth2AuthorizedClientProvider
-
- All Implemented Interfaces:
OAuth2AuthorizedClientProvider
public final class DelegatingOAuth2AuthorizedClientProvider extends java.lang.Object implements OAuth2AuthorizedClientProvider
An implementation of anOAuth2AuthorizedClientProvider
that simply delegates to it's internalList
ofOAuth2AuthorizedClientProvider
(s).Each provider is given a chance to
authorize
theclient
in the provided context with the firstnon-null
OAuth2AuthorizedClient
being returned.- Since:
- 5.2
- See Also:
OAuth2AuthorizedClientProvider
-
-
Constructor Summary
Constructors Constructor Description DelegatingOAuth2AuthorizedClientProvider(java.util.List<OAuth2AuthorizedClientProvider> authorizedClientProviders)
Constructs aDelegatingOAuth2AuthorizedClientProvider
using the provided parameters.DelegatingOAuth2AuthorizedClientProvider(OAuth2AuthorizedClientProvider... authorizedClientProviders)
Constructs aDelegatingOAuth2AuthorizedClientProvider
using the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2AuthorizedClient
authorize(OAuth2AuthorizationContext context)
Attempt to authorize (or re-authorize) theclient
in the provided context.
-
-
-
Constructor Detail
-
DelegatingOAuth2AuthorizedClientProvider
public DelegatingOAuth2AuthorizedClientProvider(OAuth2AuthorizedClientProvider... authorizedClientProviders)
Constructs aDelegatingOAuth2AuthorizedClientProvider
using the provided parameters.- Parameters:
authorizedClientProviders
- a list ofOAuth2AuthorizedClientProvider
(s)
-
DelegatingOAuth2AuthorizedClientProvider
public DelegatingOAuth2AuthorizedClientProvider(java.util.List<OAuth2AuthorizedClientProvider> authorizedClientProviders)
Constructs aDelegatingOAuth2AuthorizedClientProvider
using the provided parameters.- Parameters:
authorizedClientProviders
- aList
ofOAuth2AuthorizedClientProvider
(s)
-
-
Method Detail
-
authorize
@Nullable public OAuth2AuthorizedClient authorize(OAuth2AuthorizationContext context)
Description copied from interface:OAuth2AuthorizedClientProvider
Attempt to authorize (or re-authorize) theclient
in the provided context. Implementations must returnnull
if authorization is not supported for the specified client, e.g. the provider doesn't support theauthorization grant
type configured for the client.- Specified by:
authorize
in interfaceOAuth2AuthorizedClientProvider
- Parameters:
context
- the context that holds authorization-specific state for the client- Returns:
- the
OAuth2AuthorizedClient
ornull
if authorization is not supported for the specified client
-
-