Interface OAuth2AuthorizedClientRepository
-
- All Known Implementing Classes:
AuthenticatedPrincipalOAuth2AuthorizedClientRepository
,HttpSessionOAuth2AuthorizedClientRepository
public interface OAuth2AuthorizedClientRepository
Implementations of this interface are responsible for the persistence ofAuthorized Client(s)
between requests.The primary purpose of an
Authorized Client
is to associate anAccess Token
credential to aClient
and Resource Owner, who is thePrincipal
that originally granted the authorization.- Since:
- 5.1
- See Also:
OAuth2AuthorizedClient
,ClientRegistration
,Authentication
,OAuth2AccessToken
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends OAuth2AuthorizedClient>
TloadAuthorizedClient(java.lang.String clientRegistrationId, Authentication principal, javax.servlet.http.HttpServletRequest request)
Returns theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-UserAuthentication
(Resource Owner) ornull
if not available.void
removeAuthorizedClient(java.lang.String clientRegistrationId, Authentication principal, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Removes theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-UserAuthentication
(Resource Owner).void
saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Saves theOAuth2AuthorizedClient
associating it to the provided End-UserAuthentication
(Resource Owner).
-
-
-
Method Detail
-
loadAuthorizedClient
<T extends OAuth2AuthorizedClient> T loadAuthorizedClient(java.lang.String clientRegistrationId, Authentication principal, javax.servlet.http.HttpServletRequest request)
Returns theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-UserAuthentication
(Resource Owner) ornull
if not available.- Type Parameters:
T
- a type of OAuth2AuthorizedClient- Parameters:
clientRegistrationId
- the identifier for the client's registrationprincipal
- the End-UserAuthentication
(Resource Owner)request
- theHttpServletRequest
- Returns:
- the
OAuth2AuthorizedClient
ornull
if not available
-
saveAuthorizedClient
void saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Saves theOAuth2AuthorizedClient
associating it to the provided End-UserAuthentication
(Resource Owner).- Parameters:
authorizedClient
- the authorized clientprincipal
- the End-UserAuthentication
(Resource Owner)request
- theHttpServletRequest
response
- theHttpServletResponse
-
removeAuthorizedClient
void removeAuthorizedClient(java.lang.String clientRegistrationId, Authentication principal, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Removes theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-UserAuthentication
(Resource Owner).- Parameters:
clientRegistrationId
- the identifier for the client's registrationprincipal
- the End-UserAuthentication
(Resource Owner)request
- theHttpServletRequest
response
- theHttpServletResponse
-
-