com.google.appengine.api.users.dev
Class LoginCookieUtils
- java.lang.Object
-
- com.google.appengine.api.users.dev.LoginCookieUtils
-
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
LoginCookieUtils.CookieData
CookieData
encapsulates all of the data contained in the fake authentication cookie.
-
Field Summary
Fields 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.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Cookie
createCookie(java.lang.String email, boolean isAdmin)
Create a fake authenticationCookie
with the specified data.static java.lang.String
encodeEmailAsUserId(java.lang.String email)
static LoginCookieUtils.CookieData
getCookieData(HttpServletRequest req)
Parse the fake authenticationCookie
.static void
removeCookie(HttpServletRequest req, HttpServletResponse resp)
Remove the fake authenticationCookie
, if present.
-
-
-
Field Detail
-
COOKIE_PATH
public static final java.lang.String COOKIE_PATH
The URL path for the authentication cookie.- See Also:
- Constant Field Values
-
COOKIE_NAME
public static final java.lang.String COOKIE_NAME
The name of the authentication cookie.- See Also:
- Constant Field Values
-
-
Method Detail
-
createCookie
public static Cookie createCookie(java.lang.String email, boolean isAdmin)
Create a fake authenticationCookie
with the specified data.
-
removeCookie
public static void removeCookie(HttpServletRequest req, HttpServletResponse resp)
Remove the fake authenticationCookie
, if present.
-
getCookieData
public static LoginCookieUtils.CookieData getCookieData(HttpServletRequest req)
Parse the fake authenticationCookie
.- Returns:
- A parsed
LoginCookieUtils.CookieData
, ornull
if the user is not logged in.
-
encodeEmailAsUserId
public static java.lang.String encodeEmailAsUserId(java.lang.String email)
-
-