Class RememberMeCookieUtility
java.lang.Object
com.broadleafcommerce.auth.authorization.security.rememberme.service.RememberMeCookieUtility
Component centralizing operations on the 'remember-me' auto-login cookie.
-
Constructor Summary
ConstructorsConstructorDescriptionRememberMeCookieUtility(RememberMeLoginProperties rememberMeLoginProperties) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.servlet.http.CookiebuildAutoLoginCookie(String cookieValue, int maxAge, AuthorizedClient authorizedClient, AuthorizationServer authorizationServer, jakarta.servlet.http.HttpServletRequest request) For the given client and server (expected to be related), build a responseCookiethat establishes a new/updated auto-login remember me cookie.jakarta.servlet.http.CookiebuildAutoLoginRemovalCookie(AuthorizedClient authorizedClient, AuthorizationServer authorizationServer, jakarta.servlet.http.HttpServletRequest request) For the given client and server (expected to be related), build a responseCookiethat revokes a previously issued auto-login remember me cookie.getAutoLoginCookieName(AuthorizedClient authorizedClient, AuthorizationServer authorizationServer) For the given client and server (expected to be related), return the name of the auto-login remember me cookie.jakarta.servlet.http.CookiegetPresentedAutoLoginCookie(jakarta.servlet.http.HttpServletRequest request, AuthorizedClient authorizedClient, AuthorizationServer authorizationServer) Gets the presented auto-login remember me cookie corresponding to the givenauthorizedClient/authorizationServer.protected RememberMeLoginProperties
-
Constructor Details
-
RememberMeCookieUtility
-
-
Method Details
-
getAutoLoginCookieName
public String getAutoLoginCookieName(AuthorizedClient authorizedClient, AuthorizationServer authorizationServer) For the given client and server (expected to be related), return the name of the auto-login remember me cookie.- Parameters:
authorizedClient- the authorized client to get the auto-login cookie name forauthorizationServer- the authorization server to get the auto-login cookie name for- Returns:
- the name of the auto-login cookie
-
getPresentedAutoLoginCookie
@Nullable public jakarta.servlet.http.Cookie getPresentedAutoLoginCookie(jakarta.servlet.http.HttpServletRequest request, AuthorizedClient authorizedClient, AuthorizationServer authorizationServer) Gets the presented auto-login remember me cookie corresponding to the given
authorizedClient/authorizationServer.Adapted from
extractRememberMeCookie()inAbstractRememberMeServices.- Parameters:
request- the request from which to find the auto-login cookieauthorizedClient- the client for which to find a presented auto-login cookieauthorizationServer- the server for which to find a presented auto-login cookie- Returns:
- the found auto-login remember me cookie that corresponds to the given client/server,
else
null
-
buildAutoLoginCookie
public jakarta.servlet.http.Cookie buildAutoLoginCookie(String cookieValue, int maxAge, AuthorizedClient authorizedClient, AuthorizationServer authorizationServer, jakarta.servlet.http.HttpServletRequest request) For the given client and server (expected to be related), build a response
Cookiethat establishes a new/updated auto-login remember me cookie.Largely adapted from
setCookie()inAbstractRememberMeServices.- Parameters:
cookieValue- the value of the cookie to setmaxAge- theCookie.getMaxAge()to set. Usually the caller should set this value to matchRememberMeLoginProperties.AutoLoginCookieProperties.getTokenValidityDuration().authorizedClient- the authorized client for which to build the cookieauthorizationServer- the authorization server for which to build the cookierequest- the request for which the cookie should be built- Returns:
- an auto-login remember me cookie that can be issued in a response
-
buildAutoLoginRemovalCookie
public jakarta.servlet.http.Cookie buildAutoLoginRemovalCookie(AuthorizedClient authorizedClient, AuthorizationServer authorizationServer, jakarta.servlet.http.HttpServletRequest request) For the given client and server (expected to be related), build a response
Cookiethat revokes a previously issued auto-login remember me cookie.Largely adapted from
cancelCookie()inAbstractRememberMeServices.- Parameters:
authorizedClient- the authorized client for which to build the removal cookieauthorizationServer- the authorization server for which to build the removal cookierequest- the request for which the removal cookie should be built- Returns:
- a response cookie that unsets a previously issued auto-login remember me cookie
-
getRememberMeLoginProperties
-