Class AuthorizationCodeOAuth2AuthorizedClientProvider
java.lang.Object
org.springframework.security.oauth2.client.AuthorizationCodeOAuth2AuthorizedClientProvider
- All Implemented Interfaces:
OAuth2AuthorizedClientProvider
public final class AuthorizationCodeOAuth2AuthorizedClientProvider
extends Object
implements OAuth2AuthorizedClientProvider
An implementation of an
OAuth2AuthorizedClientProvider
for the
authorization_code
grant.- Since:
- 5.2
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauthorize
(OAuth2AuthorizationContext context) Attempt to authorize theclient
in the providedcontext
.
-
Constructor Details
-
AuthorizationCodeOAuth2AuthorizedClientProvider
public AuthorizationCodeOAuth2AuthorizedClientProvider()
-
-
Method Details
-
authorize
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
-