public class MyPersistentLoginManager
extends org.securityfilter.authenticator.persistent.DefaultPersistentLoginManager
Modifier and Type | Field and Description |
---|---|
protected String[] |
cookieDomains
The domain generalization for which the cookies are active.
|
protected String |
cookiePath
The path for which the cookies are active.
|
protected String |
cookiePrefix
The prefix that should be used for cookie names.
|
cipherParameters, COOKIE_PASSWORD, COOKIE_REMEMBERME, COOKIE_USERNAME, COOKIE_VALIDATION, cookieLife, encryptionAlgorithm, encryptionKey, encryptionMode, encryptionPadding, protection, PROTECTION_ALL, PROTECTION_ENCRYPTION, PROTECTION_NONE, PROTECTION_VALIDATION, secretKey, useIP, validationKey, valueAfterMD5, valueBeforeMD5
Constructor and Description |
---|
MyPersistentLoginManager()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
encryptText(String clearText)
Encrypt a string.
|
void |
forgetLogin(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Forget a login by removing the authentication cookies.
|
protected String |
getClientIP(javax.servlet.http.HttpServletRequest request)
Returns the original client IP.
|
String |
getCookiePrefix()
Getter for the
cookiePrefix parameter. |
String |
getRememberedPassword(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Get the password stored (in a cookie) in the request.
|
String |
getRememberedUsername(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Get the username stored (in a cookie) in the request.
|
boolean |
rememberingLogin(javax.servlet.http.HttpServletRequest request) |
void |
rememberLogin(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String username,
String password)
Remember a specific login using cookies.
|
void |
setCookieDomains(String[] cdlist)
Setter for the
cookieDomains parameter. |
void |
setCookiePath(String cp)
Setter for the
cookiePath parameter. |
void |
setCookiePrefix(String prefix)
Setter for the
cookiePrefix parameter. |
void |
setupCookie(javax.servlet.http.Cookie cookie,
boolean sessionCookie,
String cookieDomain,
javax.servlet.http.HttpServletResponse response)
Deprecated.
this shouldn't have been public, use
setupCookie(Cookie, boolean, boolean, String, HttpServletResponse) |
protected String[] cookieDomains
protected String cookiePath
protected String cookiePrefix
public MyPersistentLoginManager()
XWikiAuthServiceImpl.getAuthenticator(com.xpn.xwiki.XWikiContext)
, so no parameters are needed at this
point.public void setCookieDomains(String[] cdlist)
cookieDomains
parameter.cdlist
- The new value for cookieDomains
. The list is processed, so that any value not starting
with a dot is prefixed with one, to respect the RFC 2109.cookieDomains
public void setCookiePath(String cp)
cookiePath
parameter.cp
- The new value for cookiePath
.cookiePath
@Deprecated public void setupCookie(javax.servlet.http.Cookie cookie, boolean sessionCookie, String cookieDomain, javax.servlet.http.HttpServletResponse response)
setupCookie(Cookie, boolean, boolean, String, HttpServletResponse)
cookie
- The cookie to setup.sessionCookie
- Whether the cookie is only for this session, or for a longer period.cookieDomain
- The domain for which the cookie is set.response
- The servlet response.public void rememberLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String username, String password)
rememberLogin
in interface org.securityfilter.authenticator.persistent.PersistentLoginManagerInterface
rememberLogin
in class org.securityfilter.authenticator.persistent.DefaultPersistentLoginManager
request
- The servlet request.response
- The servlet response.username
- The username that's being remembered.password
- The password that's being remembered.public String encryptText(String clearText)
clearText
- The text to be encrypted.public void forgetLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
forgetLogin
in interface org.securityfilter.authenticator.persistent.PersistentLoginManagerInterface
forgetLogin
in class org.securityfilter.authenticator.persistent.DefaultPersistentLoginManager
request
- The servlet request.response
- The servlet response.public String getRememberedUsername(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
getRememberedUsername
in interface org.securityfilter.authenticator.persistent.PersistentLoginManagerInterface
getRememberedUsername
in class org.securityfilter.authenticator.persistent.DefaultPersistentLoginManager
request
- The servlet request.response
- The servlet response.public String getRememberedPassword(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
getRememberedPassword
in interface org.securityfilter.authenticator.persistent.PersistentLoginManagerInterface
getRememberedPassword
in class org.securityfilter.authenticator.persistent.DefaultPersistentLoginManager
request
- The servlet request.response
- The servlet response.public boolean rememberingLogin(javax.servlet.http.HttpServletRequest request)
rememberingLogin
in interface org.securityfilter.authenticator.persistent.PersistentLoginManagerInterface
rememberingLogin
in class org.securityfilter.authenticator.persistent.DefaultPersistentLoginManager
protected String getClientIP(javax.servlet.http.HttpServletRequest request)
request
- The servlet request.public void setCookiePrefix(String prefix)
cookiePrefix
parameter.prefix
- The new value for cookiePrefix
.cookiePrefix
public String getCookiePrefix()
cookiePrefix
parameter.cookiePrefix
.cookiePrefix
Copyright © 2004–2021 XWiki. All rights reserved.