|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.owasp.esapi.reference.DefaultUser
Reference implementation of the IUser interface. This implementation is serialized into a flat file in a simple format.
User,
Serialized Form| Field Summary |
| Fields inherited from interface org.owasp.esapi.User |
ANONYMOUS |
| Method Summary | |
void |
addRole(java.lang.String role)
Adds a role to an account. |
void |
addRoles(java.util.Set newRoles)
Adds the roles. |
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword1,
java.lang.String newPassword2)
Sets the user's password, performing a verification of the user's old password, the equality of the two new passwords, and the strength of the new password. |
java.lang.Object |
clone()
Override clone and make final to prevent duplicate user objects. |
void |
disable()
Disable account. |
void |
enable()
Enable the account |
java.lang.String |
getAccountName()
Gets the account name. |
java.lang.String |
getCSRFToken()
Gets the CSRF token. |
java.util.Date |
getExpirationTime()
Gets the expiration time. |
int |
getFailedLoginCount()
Gets the failed login count. |
java.util.Date |
getLastFailedLoginTime()
Gets the last failed login time. |
java.lang.String |
getLastHostAddress()
Returns the last host address used by the user. |
java.util.Date |
getLastLoginTime()
Gets the last login time. |
java.util.Date |
getLastPasswordChangeTime()
Gets the last password change time. |
java.util.Set |
getRoles()
Gets the roles. |
java.lang.String |
getScreenName()
Gets the screen name. |
void |
incrementFailedLoginCount()
Increment failed login count. |
boolean |
isAnonymous()
Checks if is anonymous. |
boolean |
isEnabled()
Checks if is enabled. |
boolean |
isExpired()
Checks if an account is expired. |
boolean |
isInRole(java.lang.String role)
Checks if an account has been assigned a particular role. |
boolean |
isLocked()
Checks if an account is unlocked. |
boolean |
isLoggedIn()
Tests to see if the user is currently logged in. |
boolean |
isSessionAbsoluteTimeout()
Tests to see if the user's session has exceeded the absolute time out. |
boolean |
isSessionTimeout()
Tests to see if the user's session has timed out from inactivity. |
void |
lock()
Lock the user's account. |
void |
loginWithPassword(java.lang.String password)
Login with password. |
void |
logout()
Logout this user. |
void |
removeRole(java.lang.String role)
Removes a role from an account. |
java.lang.String |
resetCSRFToken()
In this implementation, we have chosen to use a random token that is stored in the User object. |
void |
setAccountName(java.lang.String accountName)
Sets the account name. |
void |
setExpirationTime(java.util.Date expirationTime)
Sets the expiration time. |
void |
setLastFailedLoginTime(java.util.Date lastFailedLoginTime)
Sets the last failed login time. |
void |
setLastHostAddress(java.lang.String remoteHost)
Sets the last remote host address used by this User. |
void |
setLastLoginTime(java.util.Date lastLoginTime)
Sets the last login time. |
void |
setLastPasswordChangeTime(java.util.Date lastPasswordChangeTime)
Sets the last password change time. |
void |
setRoles(java.util.Set roles)
Sets the roles. |
void |
setScreenName(java.lang.String screenName)
Sets the screen name. |
java.lang.String |
toString()
|
void |
unlock()
Unlock account. |
boolean |
verifyPassword(java.lang.String password)
Verify that the supplied password matches the password for this user. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public void addRole(java.lang.String role)
throws AuthenticationException
User
addRole in interface Userrole - the role
AuthenticationException - the authentication exception
public void addRoles(java.util.Set newRoles)
throws AuthenticationException
User
addRoles in interface UsernewRoles - the new roles
AuthenticationException - the authentication exception
public void changePassword(java.lang.String oldPassword,
java.lang.String newPassword1,
java.lang.String newPassword2)
throws AuthenticationException,
EncryptionException
User
changePassword in interface UseroldPassword - the old passwordnewPassword1 - the new password1newPassword2 - the new password2
EncryptionException
AuthenticationException - the authentication exceptionpublic void disable()
User
disable in interface Userpublic void enable()
enable in interface UserUser.enable()public java.lang.String getAccountName()
getAccountName in interface Userpublic java.lang.String getCSRFToken()
getCSRFToken in interface Userpublic java.util.Date getExpirationTime()
public int getFailedLoginCount()
getFailedLoginCount in interface Userpublic java.util.Date getLastFailedLoginTime()
getLastFailedLoginTime in interface Userpublic java.lang.String getLastHostAddress()
User
getLastHostAddress in interface Userpublic java.util.Date getLastLoginTime()
getLastLoginTime in interface Userpublic java.util.Date getLastPasswordChangeTime()
getLastPasswordChangeTime in interface Userpublic java.util.Set getRoles()
getRoles in interface Userpublic java.lang.String getScreenName()
User
getScreenName in interface Userpublic void incrementFailedLoginCount()
User
incrementFailedLoginCount in interface Userpublic boolean isAnonymous()
User
isAnonymous in interface Userpublic boolean isEnabled()
isEnabled in interface Userpublic boolean isExpired()
User
isExpired in interface Userpublic boolean isInRole(java.lang.String role)
User
isInRole in interface Userrole - the role
public boolean isLocked()
User
isLocked in interface Userpublic boolean isLoggedIn()
User
isLoggedIn in interface Userpublic boolean isSessionAbsoluteTimeout()
User
isSessionAbsoluteTimeout in interface Userpublic boolean isSessionTimeout()
User
isSessionTimeout in interface Userpublic void lock()
User
lock in interface User
public void loginWithPassword(java.lang.String password)
throws AuthenticationException
User
loginWithPassword in interface Userpassword - the password
AuthenticationException - the authentication exceptionpublic void logout()
User
logout in interface Userpublic void removeRole(java.lang.String role)
User
removeRole in interface Userrole - the rolepublic java.lang.String resetCSRFToken()
resetCSRFToken in interface UserUser.resetCSRFToken()public void setAccountName(java.lang.String accountName)
setAccountName in interface UseraccountName - the accountName to setpublic void setExpirationTime(java.util.Date expirationTime)
expirationTime - the expirationTime to setpublic void setLastFailedLoginTime(java.util.Date lastFailedLoginTime)
lastFailedLoginTime - the lastFailedLoginTime to setpublic void setLastHostAddress(java.lang.String remoteHost)
remoteHost - public void setLastLoginTime(java.util.Date lastLoginTime)
lastLoginTime - the lastLoginTime to setpublic void setLastPasswordChangeTime(java.util.Date lastPasswordChangeTime)
lastPasswordChangeTime - the lastPasswordChangeTime to set
public void setRoles(java.util.Set roles)
throws AuthenticationException
setRoles in interface Userroles - the roles to set
AuthenticationExceptionpublic void setScreenName(java.lang.String screenName)
User
setScreenName in interface UserscreenName - the new screen namepublic java.lang.String toString()
public void unlock()
User
unlock in interface Userpublic boolean verifyPassword(java.lang.String password)
User
verifyPassword in interface Userpassword -
public final java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||