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 anOAuth2AuthorizedClientProviderfor theauthorization_codegrant.- 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 OAuth2AuthorizedClientauthorize(OAuth2AuthorizationContext context)Attempt to authorize theclientin the providedcontext.
-
-
-
Method Detail
-
authorize
@Nullable public OAuth2AuthorizedClient authorize(OAuth2AuthorizationContext context)
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
-
-