public class CmsJspLoginPersistingBean extends CmsJspLoginBean
CmsPersistentLoginAuthorizationHandler to automatically
log the user back in when his session has expired.
The cookie's lifetime can be set using the setTokenLifetime methodNOT_INITIALIZED| Constructor and Description |
|---|
CmsJspLoginPersistingBean() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCookiePath(boolean resolveMacros)
Gets the path to use for the authorization cookie, optionally resolving any macros used.
|
boolean |
isTokenSet()
Returns true if the token has been set.
|
void |
login(java.lang.String userName,
java.lang.String password,
java.lang.String projectName)
Logs a system user into OpenCms.
|
void |
logout()
Logs a user out, i.e. destroys the current users session,
after that the current page will be redirected to itself one time to ensure that
the users session is truly destroyed.
|
void |
logout(boolean invalidateToken)
Logs the user out and optionally invalidates their login token.
|
void |
setCookiePath(java.lang.String cookiePath)
Sets the path to use for the login token cookie.
|
void |
setTokenLifetime(long lifetime)
Sets the number of milliseconds for which the tokens should be valid.
|
getFormLink, getLoginException, getUser, getUserName, isLoggedIn, isLoginSuccess, login, login, logLoginExceptioneditable, editable, editable, editableManualClose, editableManualOpen, getContent, getContent, getMessages, getMessages, getMessages, getMessages, getNavigation, getNavigationUri, img, img, include, include, include, include, include, include, includeSilent, includeSilent, includeSilent, includeSilent, info, label, link, link, properties, properties, property, property, property, property, template, template, template, toAbsolute, usergetCmsObject, getController, getJspContext, getMessage, getRequest, getRequestContext, getResponse, handleException, handleMissingFlexController, init, isNotInitialized, isSupressingExceptions, setContentType, setStatus, setSupressingExceptionspublic CmsJspLoginPersistingBean()
public java.lang.String getCookiePath(boolean resolveMacros)
resolveMacros - if true, macros should be resolvedpublic boolean isTokenSet()
public void login(java.lang.String userName, java.lang.String password, java.lang.String projectName)
CmsJspLoginBeanNote that if a login project name is provided, this project must exist, otherwise the login is regarded as a failure even if the user data was correct.
login in class CmsJspLoginBeanuserName - the users namepassword - the passwordprojectName - the project to switch to after login (if null project is not switched)CmsJspLoginBean.login(java.lang.String, java.lang.String, java.lang.String)public void logout() throws java.io.IOException
CmsJspLoginBeanlogout in class CmsJspLoginBeanjava.io.IOException - if redirect after logout failsCmsJspLoginBean.logout()public void logout(boolean invalidateToken) throws java.io.IOException
invalidateToken - true if the token should be invalidatedjava.io.IOException - if something goes wrongpublic void setCookiePath(java.lang.String cookiePath)
You can use the macros %(SERVLET_NAME) and %(CONTEXT_NAME) in the cookie path; the default value is %(CONTEXT_NAME)%(SERVLET_NAME).
cookiePath - the cookie path, possibly including macrospublic void setTokenLifetime(long lifetime)
lifetime - the token life time