public final class DelegatingOAuth2AuthorizedClientProvider extends java.lang.Object implements OAuth2AuthorizedClientProvider
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.
OAuth2AuthorizedClientProvider
Constructor and Description |
---|
DelegatingOAuth2AuthorizedClientProvider(java.util.List<OAuth2AuthorizedClientProvider> authorizedClientProviders)
Constructs a
DelegatingOAuth2AuthorizedClientProvider using the provided parameters. |
DelegatingOAuth2AuthorizedClientProvider(OAuth2AuthorizedClientProvider... authorizedClientProviders)
Constructs a
DelegatingOAuth2AuthorizedClientProvider using the provided parameters. |
Modifier and Type | Method and Description |
---|---|
OAuth2AuthorizedClient |
authorize(OAuth2AuthorizationContext context)
Attempt to authorize (or re-authorize) the
client in the provided context. |
public DelegatingOAuth2AuthorizedClientProvider(OAuth2AuthorizedClientProvider... authorizedClientProviders)
DelegatingOAuth2AuthorizedClientProvider
using the provided parameters.authorizedClientProviders
- a list of OAuth2AuthorizedClientProvider
(s)public DelegatingOAuth2AuthorizedClientProvider(java.util.List<OAuth2AuthorizedClientProvider> authorizedClientProviders)
DelegatingOAuth2AuthorizedClientProvider
using the provided parameters.authorizedClientProviders
- a List
of OAuth2AuthorizedClientProvider
(s)@Nullable public OAuth2AuthorizedClient authorize(OAuth2AuthorizationContext context)
OAuth2AuthorizedClientProvider
client
in the provided context.
Implementations must return null
if authorization is not supported for the specified client,
e.g. the provider doesn't support the authorization grant
type configured for the client.authorize
in interface OAuth2AuthorizedClientProvider
context
- the context that holds authorization-specific state for the clientOAuth2AuthorizedClient
or null
if authorization is not supported for the specified client