public final class LoginCookieUtils
extends java.lang.Object
LoginCookieUtils encapsulates the creation, deletion, and
parsing of the fake authentication cookie used by the Development
Appserver to simulate login.| Modifier and Type | Class and Description |
|---|---|
static class |
LoginCookieUtils.CookieData
CookieData encapsulates all of the data contained in the
fake authentication cookie. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COOKIE_NAME
The name of the authentication cookie.
|
static java.lang.String |
COOKIE_PATH
The URL path for the authentication cookie.
|
| Modifier and Type | Method and Description |
|---|---|
static Cookie |
createCookie(java.lang.String email,
boolean isAdmin)
Create a fake authentication
Cookie with the specified data. |
static java.lang.String |
encodeEmailAsUserId(java.lang.String email) |
static LoginCookieUtils.CookieData |
getCookieData(HttpServletRequest req)
Parse the fake authentication
Cookie. |
static void |
removeCookie(HttpServletRequest req,
HttpServletResponse resp)
Remove the fake authentication
Cookie, if present. |
public static final java.lang.String COOKIE_PATH
public static final java.lang.String COOKIE_NAME
public static Cookie createCookie(java.lang.String email,
boolean isAdmin)
Cookie with the specified data.public static void removeCookie(HttpServletRequest req,
HttpServletResponse resp)
Cookie, if present.public static LoginCookieUtils.CookieData getCookieData(HttpServletRequest req)
Cookie.LoginCookieUtils.CookieData, or null if the
user is not logged in.public static java.lang.String encodeEmailAsUserId(java.lang.String email)