Class AuthorizationCodeReactiveOAuth2AuthorizedClientProvider
java.lang.Object
org.springframework.security.oauth2.client.AuthorizationCodeReactiveOAuth2AuthorizedClientProvider
- All Implemented Interfaces:
ReactiveOAuth2AuthorizedClientProvider
public final class AuthorizationCodeReactiveOAuth2AuthorizedClientProvider
extends Object
implements ReactiveOAuth2AuthorizedClientProvider
An implementation of a
ReactiveOAuth2AuthorizedClientProvider
for the
authorization_code
grant.- Since:
- 5.2
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<OAuth2AuthorizedClient>
authorize
(OAuth2AuthorizationContext context) Attempt to authorize theclient
in the providedcontext
.
-
Constructor Details
-
AuthorizationCodeReactiveOAuth2AuthorizedClientProvider
public AuthorizationCodeReactiveOAuth2AuthorizedClientProvider()
-
-
Method Details
-
authorize
public reactor.core.publisher.Mono<OAuth2AuthorizedClient> authorize(OAuth2AuthorizationContext context) Attempt to authorize theclient
in the providedcontext
. Returns an emptyMono
if authorization is not supported, e.g. the client'sauthorization grant type
is notauthorization_code
OR the client is already authorized.- Specified by:
authorize
in interfaceReactiveOAuth2AuthorizedClientProvider
- Parameters:
context
- the context that holds authorization-specific state for the client- Returns:
- an empty
Mono
if authorization is not supported or the client is already authorized - Throws:
ClientAuthorizationRequiredException
- in order to trigger authorization in which theOAuth2AuthorizationRequestRedirectWebFilter
will catch and initiate the authorization request
-