|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.owasp.esapi.User
Reference implementation of the IUser interface. This implementation is serialized into a flat file in a simple format.
IUser,
Serialized Form| Field Summary |
| Fields inherited from interface org.owasp.esapi.interfaces.IUser |
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 |
boolean |
equals(java.lang.Object obj)
|
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. |
int |
hashCode()
|
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. |
java.lang.String |
resetPassword()
Reset password. |
java.lang.String |
resetRememberToken()
Regenerates the user's remember token by sealing the account name and hashed password with a timestamp. |
void |
setAccountName(java.lang.String accountName)
Sets the account name. |
void |
setExpirationTime(java.util.Date expirationTime)
Sets the expiration time. |
void |
setLastHostAddress(java.lang.String remoteHost)
Sets the last remote host address used by this User. |
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 |
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
public void addRole(java.lang.String role)
throws AuthenticationException
IUser
addRole in interface IUserrole - the role
AuthenticationException - the authentication exception
public void addRoles(java.util.Set newRoles)
throws AuthenticationException
IUser
addRoles in interface IUsernewRoles - 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
IUser
changePassword in interface IUseroldPassword - the old passwordnewPassword1 - the new password1newPassword2 - the new password2
EncryptionException
AuthenticationException - the authentication exceptionpublic void disable()
IUser
disable in interface IUserpublic void enable()
enable in interface IUserIUser.enable()public boolean equals(java.lang.Object obj)
public java.lang.String getAccountName()
getAccountName in interface IUserpublic java.lang.String getCSRFToken()
getCSRFToken in interface IUserpublic java.util.Date getExpirationTime()
public int getFailedLoginCount()
getFailedLoginCount in interface IUserpublic java.util.Date getLastFailedLoginTime()
getLastFailedLoginTime in interface IUserpublic java.lang.String getLastHostAddress()
IUser
getLastHostAddress in interface IUserpublic java.util.Date getLastLoginTime()
getLastLoginTime in interface IUserpublic java.util.Date getLastPasswordChangeTime()
getLastPasswordChangeTime in interface IUserpublic java.util.Set getRoles()
getRoles in interface IUserpublic java.lang.String getScreenName()
IUser
getScreenName in interface IUserpublic int hashCode()
public void incrementFailedLoginCount()
IUser
incrementFailedLoginCount in interface IUserpublic boolean isAnonymous()
IUser
isAnonymous in interface IUserpublic boolean isEnabled()
isEnabled in interface IUserpublic boolean isExpired()
IUser
isExpired in interface IUserpublic boolean isInRole(java.lang.String role)
IUser
isInRole in interface IUserrole - the role
public boolean isLocked()
IUser
isLocked in interface IUserpublic boolean isLoggedIn()
IUser
isLoggedIn in interface IUserpublic boolean isSessionAbsoluteTimeout()
IUser
isSessionAbsoluteTimeout in interface IUserpublic boolean isSessionTimeout()
IUser
isSessionTimeout in interface IUserpublic void lock()
IUser
lock in interface IUser
public void loginWithPassword(java.lang.String password)
throws AuthenticationException
IUser
loginWithPassword in interface IUserpassword - the password
AuthenticationException - the authentication exceptionpublic void logout()
IUser
logout in interface IUserpublic void removeRole(java.lang.String role)
IUser
removeRole in interface IUserrole - the rolepublic java.lang.String resetCSRFToken()
resetCSRFToken in interface IUserIUser.resetCSRFToken()
public java.lang.String resetPassword()
throws EncryptionException
EncryptionExceptionorg.owasp.esapi.interfaces.IUser#setPassword(java.lang.String, java.lang.String)
public java.lang.String resetRememberToken()
throws AuthenticationException
resetRememberToken in interface IUserAuthenticationException - the authentication exceptionpublic void setAccountName(java.lang.String accountName)
setAccountName in interface IUseraccountName - the accountName to setpublic void setExpirationTime(java.util.Date expirationTime)
expirationTime - the expirationTime to setpublic void setLastHostAddress(java.lang.String remoteHost)
remoteHost -
public void setRoles(java.util.Set roles)
throws AuthenticationException
setRoles in interface IUserroles - the roles to set
AuthenticationExceptionpublic void setScreenName(java.lang.String screenName)
IUser
setScreenName in interface IUserscreenName - the new screen namepublic java.lang.String toString()
public void unlock()
IUser
unlock in interface IUserpublic boolean verifyPassword(java.lang.String password)
IUser
verifyPassword in interface IUserpassword -
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 | ||||||||||