Class DelegatingReactiveOAuth2AuthorizedClientProvider
java.lang.Object
org.springframework.security.oauth2.client.DelegatingReactiveOAuth2AuthorizedClientProvider
- All Implemented Interfaces:
ReactiveOAuth2AuthorizedClientProvider
public final class DelegatingReactiveOAuth2AuthorizedClientProvider
extends Object
implements ReactiveOAuth2AuthorizedClientProvider
An implementation of a
ReactiveOAuth2AuthorizedClientProvider
that simply
delegates to it's internal List
of
ReactiveOAuth2AuthorizedClientProvider
(s).
Each provider is given a chance to
authorize
the client
in the
provided context with the first available OAuth2AuthorizedClient
being
returned.
- Since:
- 5.2
- See Also:
-
Constructor Summary
ConstructorDescriptionDelegatingReactiveOAuth2AuthorizedClientProvider
(List<ReactiveOAuth2AuthorizedClientProvider> authorizedClientProviders) Constructs aDelegatingReactiveOAuth2AuthorizedClientProvider
using the provided parameters.DelegatingReactiveOAuth2AuthorizedClientProvider
(ReactiveOAuth2AuthorizedClientProvider... authorizedClientProviders) Constructs aDelegatingReactiveOAuth2AuthorizedClientProvider
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<OAuth2AuthorizedClient>
authorize
(OAuth2AuthorizationContext context) Attempt to authorize (or re-authorize) theclient
in the provided context.
-
Constructor Details
-
DelegatingReactiveOAuth2AuthorizedClientProvider
public DelegatingReactiveOAuth2AuthorizedClientProvider(ReactiveOAuth2AuthorizedClientProvider... authorizedClientProviders) Constructs aDelegatingReactiveOAuth2AuthorizedClientProvider
using the provided parameters.- Parameters:
authorizedClientProviders
- a list ofReactiveOAuth2AuthorizedClientProvider
(s)
-
DelegatingReactiveOAuth2AuthorizedClientProvider
public DelegatingReactiveOAuth2AuthorizedClientProvider(List<ReactiveOAuth2AuthorizedClientProvider> authorizedClientProviders) Constructs aDelegatingReactiveOAuth2AuthorizedClientProvider
using the provided parameters.- Parameters:
authorizedClientProviders
- aList
ofOAuth2AuthorizedClientProvider
(s)
-
-
Method Details
-
authorize
public reactor.core.publisher.Mono<OAuth2AuthorizedClient> authorize(OAuth2AuthorizationContext context) Description copied from interface:ReactiveOAuth2AuthorizedClientProvider
Attempt to authorize (or re-authorize) theclient
in the provided context. Implementations must return an emptyMono
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 interfaceReactiveOAuth2AuthorizedClientProvider
- Parameters:
context
- the context that holds authorization-specific state for the client- Returns:
- the
OAuth2AuthorizedClient
or an emptyMono
if authorization is not supported for the specified client
-