Interface OAuth2AuthorizedClientManager
- All Known Implementing Classes:
AuthorizedClientServiceOAuth2AuthorizedClientManager
,DefaultOAuth2AuthorizedClientManager
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Implementations of this interface are responsible for the overall management of
Authorized Client(s)
.
The primary responsibilities include:
- Authorizing (or re-authorizing) an OAuth 2.0 Client by leveraging an
OAuth2AuthorizedClientProvider
(s). - Delegating the persistence of an
OAuth2AuthorizedClient
, typically using anOAuth2AuthorizedClientService
OROAuth2AuthorizedClientRepository
.
-
Method Summary
Modifier and TypeMethodDescriptionauthorize
(OAuth2AuthorizeRequest authorizeRequest) Attempt to authorize or re-authorize (if required) theclient
identified by the providedclientRegistrationId
.
-
Method Details
-
authorize
Attempt to authorize or re-authorize (if required) theclient
identified by the providedclientRegistrationId
. Implementations must returnnull
if authorization is not supported for the specified client, e.g. the associatedOAuth2AuthorizedClientProvider
(s) does not support theauthorization grant
type configured for the client.In the case of re-authorization, implementations must return the provided
authorized client
if re-authorization is not supported for the client OR is not required, e.g. arefresh token
is not available OR theaccess token
is not expired.- Parameters:
authorizeRequest
- the authorize request- Returns:
- the
OAuth2AuthorizedClient
ornull
if authorization is not supported for the specified client
-