Class HttpSessionOAuth2AuthorizedClientRepository
java.lang.Object
org.springframework.security.oauth2.client.web.HttpSessionOAuth2AuthorizedClientRepository
- All Implemented Interfaces:
OAuth2AuthorizedClientRepository
public final class HttpSessionOAuth2AuthorizedClientRepository
extends Object
implements OAuth2AuthorizedClientRepository
An implementation of an
OAuth2AuthorizedClientRepository that stores
OAuth2AuthorizedClient's in the HttpSession.- Since:
- 5.1
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends OAuth2AuthorizedClient>
TloadAuthorizedClient(String clientRegistrationId, Authentication principal, jakarta.servlet.http.HttpServletRequest request) Returns theOAuth2AuthorizedClientassociated to the provided client registration identifier and End-UserAuthentication(Resource Owner) ornullif not available.voidremoveAuthorizedClient(String clientRegistrationId, Authentication principal, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Removes theOAuth2AuthorizedClientassociated to the provided client registration identifier and End-UserAuthentication(Resource Owner).voidsaveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Saves theOAuth2AuthorizedClientassociating it to the provided End-UserAuthentication(Resource Owner).
-
Constructor Details
-
HttpSessionOAuth2AuthorizedClientRepository
public HttpSessionOAuth2AuthorizedClientRepository()
-
-
Method Details
-
loadAuthorizedClient
public <T extends OAuth2AuthorizedClient> T loadAuthorizedClient(String clientRegistrationId, Authentication principal, jakarta.servlet.http.HttpServletRequest request) Description copied from interface:OAuth2AuthorizedClientRepositoryReturns theOAuth2AuthorizedClientassociated to the provided client registration identifier and End-UserAuthentication(Resource Owner) ornullif not available.- Specified by:
loadAuthorizedClientin 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
OAuth2AuthorizedClientornullif not available
-
saveAuthorizedClient
public void saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:OAuth2AuthorizedClientRepositorySaves theOAuth2AuthorizedClientassociating it to the provided End-UserAuthentication(Resource Owner).- Specified by:
saveAuthorizedClientin interfaceOAuth2AuthorizedClientRepository- Parameters:
authorizedClient- the authorized clientprincipal- the End-UserAuthentication(Resource Owner)request- theHttpServletRequestresponse- theHttpServletResponse
-
removeAuthorizedClient
public void removeAuthorizedClient(String clientRegistrationId, Authentication principal, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:OAuth2AuthorizedClientRepositoryRemoves theOAuth2AuthorizedClientassociated to the provided client registration identifier and End-UserAuthentication(Resource Owner).- Specified by:
removeAuthorizedClientin interfaceOAuth2AuthorizedClientRepository- Parameters:
clientRegistrationId- the identifier for the client's registrationprincipal- the End-UserAuthentication(Resource Owner)request- theHttpServletRequestresponse- theHttpServletResponse
-