|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jsecurity.subject.AbstractRememberMeManager
org.jsecurity.web.WebRememberMeManager
public class WebRememberMeManager
Remembers a Subject's identity by using a WebAttribute instance to retain
the identity value between web requests.
This class's default WebAttribute instance is a CookieAttribute, storing
the Subject's principals in a Cookie. Note that
because this class subclasses the AbstractRememberMeManager which already provides serialization and
encryption logic, this class utilizes both for added security before setting the cookie value.
This class also contains "passthrough" JavaBeans-compatible getters/setters for the underlying
CookieAttribute's properties to make configuration easier.
Note however as a basic sanity check, these passthrough methods will first assert that the underlying
identityAttribute is actually a CookieAttribute. If it
is not, an IllegalStateException will be thrown. Because the default instance of this class is
already CookieAttribute, you would only ever experience the exception if you explicitly
override the internal instance with a different type and accidentally call one of these JavaBeans passthrough
methods.
Just be aware of this if you manually override the identityAttribute property
to be an instance of something other than a CookieAttribute.
| Field Summary | |
|---|---|
static String |
DEFAULT_REMEMBER_ME_COOKIE_NAME
The default name of the underlying rememberMe cookie which is rememberMe. |
protected WebAttribute<String> |
identityAttribute
|
| Constructor Summary | |
|---|---|
WebRememberMeManager()
|
|
| Method Summary | |
|---|---|
protected void |
assertCookieAttribute()
|
protected void |
forgetIdentity()
|
int |
getCookieMaxAge()
Passthrough JavaBeans property that will get the underyling rememberMe cookie's max age. |
String |
getCookieName()
Passthrough JavaBeans property that will get the underyling rememberMe cookie's name. |
String |
getCookiePath()
Passthrough JavaBeans property that will get the underyling rememberMe cookie's path. |
WebAttribute<String> |
getIdentityAttribute()
|
protected byte[] |
getSerializedRememberedIdentity()
|
boolean |
isCookieSecure()
Passthrough JavaBeans property that will get the underyling rememberMe cookie's 'secure' status. |
protected void |
rememberSerializedIdentity(byte[] serialized)
|
void |
setCookieMaxAge(int maxAge)
Passthrough JavaBeans property that will get the underyling rememberMe cookie's max age. |
void |
setCookieName(String name)
Passthrough JavaBeans property that will set the underyling rememberMe cookie's name. |
void |
setCookiePath(String path)
Passthrough JavaBeans property that will set the underyling rememberMe cookie's path. |
void |
setCookieSecure(boolean secure)
Passthrough JavaBeans property that will set the underyling rememberMe cookie's 'secure' status. |
void |
setIdentityAttribute(WebAttribute<String> identityAttribute)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_REMEMBER_ME_COOKIE_NAME
rememberMe.
protected WebAttribute<String> identityAttribute
| Constructor Detail |
|---|
public WebRememberMeManager()
| Method Detail |
|---|
public WebAttribute<String> getIdentityAttribute()
public void setIdentityAttribute(WebAttribute<String> identityAttribute)
protected void assertCookieAttribute()
public String getCookieName()
The default value is DEFAULT_REMEMBER_ME_COOKIE_NAME
This method performs a quick CookieAttribute sanity check as described in the class-level JavaDoc.
public void setCookieName(String name)
The default value is DEFAULT_REMEMBER_ME_COOKIE_NAME
This method performs a quick CookieAttribute sanity check as described in the class-level JavaDoc.
name - the name to assign to the underlying rememberMe cookiepublic String getCookiePath()
This method performs a quick CookieAttribute sanity check as described in the class-level JavaDoc.
public void setCookiePath(String path)
This method performs a quick CookieAttribute sanity check as described in the class-level JavaDoc.
path - the path to assign to the underlying rememberMe cookiepublic int getCookieMaxAge()
This method performs a quick CookieAttribute sanity check as described in the class-level JavaDoc.
public void setCookieMaxAge(int maxAge)
This method performs a quick CookieAttribute sanity check as described in the class-level JavaDoc.
maxAge - the max age to assign to the underlying rememberMe cookiepublic boolean isCookieSecure()
This method performs a quick CookieAttribute sanity check as described in the class-level JavaDoc.
public void setCookieSecure(boolean secure)
This method performs a quick CookieAttribute sanity check as described in the class-level JavaDoc.
secure - the 'secure' flag to assign to the underlying rememberMe cookie.protected void rememberSerializedIdentity(byte[] serialized)
rememberSerializedIdentity in class AbstractRememberMeManagerprotected byte[] getSerializedRememberedIdentity()
getSerializedRememberedIdentity in class AbstractRememberMeManagerprotected void forgetIdentity()
forgetIdentity in class AbstractRememberMeManager
|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||