Class DelegatingOAuth2AuthorizedClientProvider
java.lang.Object
org.springframework.security.oauth2.client.DelegatingOAuth2AuthorizedClientProvider
- All Implemented Interfaces:
OAuth2AuthorizedClientProvider
public final class DelegatingOAuth2AuthorizedClientProvider
extends Object
implements OAuth2AuthorizedClientProvider
An implementation of an
OAuth2AuthorizedClientProvider
that simply delegates to
it's internal List
of OAuth2AuthorizedClientProvider
(s).
Each provider is given a chance to
authorize
the client
in the provided
context with the first non-null
OAuth2AuthorizedClient
being returned.
- Since:
- 5.2
- See Also:
-
Constructor Summary
ConstructorDescriptionDelegatingOAuth2AuthorizedClientProvider
(List<OAuth2AuthorizedClientProvider> authorizedClientProviders) Constructs aDelegatingOAuth2AuthorizedClientProvider
using the provided parameters.DelegatingOAuth2AuthorizedClientProvider
(OAuth2AuthorizedClientProvider... authorizedClientProviders) Constructs aDelegatingOAuth2AuthorizedClientProvider
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionauthorize
(OAuth2AuthorizationContext context) Attempt to authorize (or re-authorize) theclient
in the provided context.
-
Constructor Details
-
DelegatingOAuth2AuthorizedClientProvider
public DelegatingOAuth2AuthorizedClientProvider(OAuth2AuthorizedClientProvider... authorizedClientProviders) Constructs aDelegatingOAuth2AuthorizedClientProvider
using the provided parameters.- Parameters:
authorizedClientProviders
- a list ofOAuth2AuthorizedClientProvider
(s)
-
DelegatingOAuth2AuthorizedClientProvider
public DelegatingOAuth2AuthorizedClientProvider(List<OAuth2AuthorizedClientProvider> authorizedClientProviders) Constructs aDelegatingOAuth2AuthorizedClientProvider
using the provided parameters.- Parameters:
authorizedClientProviders
- aList
ofOAuth2AuthorizedClientProvider
(s)
-
-
Method Details
-
authorize
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
-