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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthorize(OAuth2AuthorizationContext context) Attempt to authorize theclientin the providedcontext.
-
Constructor Details
-
AuthorizationCodeOAuth2AuthorizedClientProvider
public AuthorizationCodeOAuth2AuthorizedClientProvider()
-
-
Method Details
-
authorize
Attempt to authorize theclientin the providedcontext. Returnsnullif authorization is not supported, e.g. the client'sauthorization grant typeis notauthorization_codeOR the client is already authorized.- Specified by:
authorizein interfaceOAuth2AuthorizedClientProvider- Parameters:
context- the context that holds authorization-specific state for the client- Returns:
nullif authorization is not supported or the client is already authorized- Throws:
ClientAuthorizationRequiredException- in order to trigger authorization in which theOAuth2AuthorizationRequestRedirectFilterwill catch and initiate the authorization request
-