Class HttpSessionOAuth2AuthorizedClientRepository
- java.lang.Object
-
- org.springframework.security.oauth2.client.web.HttpSessionOAuth2AuthorizedClientRepository
-
- All Implemented Interfaces:
OAuth2AuthorizedClientRepository
public final class HttpSessionOAuth2AuthorizedClientRepository extends java.lang.Object implements OAuth2AuthorizedClientRepository
An implementation of anOAuth2AuthorizedClientRepository
that storesOAuth2AuthorizedClient
's in theHttpSession
.- Since:
- 5.1
- See Also:
OAuth2AuthorizedClientRepository
,OAuth2AuthorizedClient
-
-
Constructor Summary
Constructors Constructor Description HttpSessionOAuth2AuthorizedClientRepository()
-
Method Summary
All Methods Instance Methods Concrete 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
public <T extends OAuth2AuthorizedClient> T loadAuthorizedClient(java.lang.String clientRegistrationId, Authentication principal, javax.servlet.http.HttpServletRequest request)
Description copied from interface:OAuth2AuthorizedClientRepository
Returns theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-UserAuthentication
(Resource Owner) ornull
if not available.- Specified by:
loadAuthorizedClient
in interfaceOAuth2AuthorizedClientRepository
- 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
public void saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Description copied from interface:OAuth2AuthorizedClientRepository
Saves theOAuth2AuthorizedClient
associating it to the provided End-UserAuthentication
(Resource Owner).- Specified by:
saveAuthorizedClient
in interfaceOAuth2AuthorizedClientRepository
- Parameters:
authorizedClient
- the authorized clientprincipal
- the End-UserAuthentication
(Resource Owner)request
- theHttpServletRequest
response
- theHttpServletResponse
-
removeAuthorizedClient
public void removeAuthorizedClient(java.lang.String clientRegistrationId, Authentication principal, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Description copied from interface:OAuth2AuthorizedClientRepository
Removes theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-UserAuthentication
(Resource Owner).- Specified by:
removeAuthorizedClient
in interfaceOAuth2AuthorizedClientRepository
- Parameters:
clientRegistrationId
- the identifier for the client's registrationprincipal
- the End-UserAuthentication
(Resource Owner)request
- theHttpServletRequest
response
- theHttpServletResponse
-
-