Class AuthorizationCodeOAuth2AuthorizedClientProvider
- java.lang.Object
-
- org.springframework.security.oauth2.client.AuthorizationCodeOAuth2AuthorizedClientProvider
-
- All Implemented Interfaces:
OAuth2AuthorizedClientProvider
public final class AuthorizationCodeOAuth2AuthorizedClientProvider extends java.lang.Object implements OAuth2AuthorizedClientProvider
An implementation of anOAuth2AuthorizedClientProvider
for theauthorization_code
grant.- Since:
- 5.2
- See Also:
OAuth2AuthorizedClientProvider
-
-
Constructor Summary
Constructors Constructor Description AuthorizationCodeOAuth2AuthorizedClientProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2AuthorizedClient
authorize(OAuth2AuthorizationContext context)
Attempt to authorize theclient
in the providedcontext
.
-
-
-
Method Detail
-
authorize
@Nullable public OAuth2AuthorizedClient authorize(OAuth2AuthorizationContext context)
Attempt to authorize theclient
in the providedcontext
. Returnsnull
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 interfaceOAuth2AuthorizedClientProvider
- Parameters:
context
- the context that holds authorization-specific state for the client- Returns:
null
if authorization is not supported or the client is already authorized- Throws:
ClientAuthorizationRequiredException
- in order to trigger authorization in which theOAuth2AuthorizationRequestRedirectFilter
will catch and initiate the authorization request
-
-