|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The IUser interface represents an application user or user account. There is quite a lot of information that an application must store for each user in order to enforce security properly. There are also many rules that govern authentication and identity management.
A user account can be in one of several states. When first created, a User should be disabled, not expired, and unlocked. To start using the account, an administrator should enable the account. The account can be locked for a number of reasons, most commonly because they have failed login for too many times. Finally, the account can expire after the expiration date has been reached. The User must be enabled, not expired, and unlocked in order to pass authentication.
| Field Summary | |
static 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. |
void |
disable()
Disable account. |
void |
enable()
Enable account. |
java.lang.String |
getAccountName()
Gets the account name. |
java.lang.String |
getCSRFToken()
Gets the CSRF token. |
int |
getFailedLoginCount()
Returns the number of failed login attempts since the last successful login for an account. |
java.util.Date |
getLastFailedLoginTime()
Returns the date of the last failed login time for a user. |
java.lang.String |
getLastHostAddress()
Returns the last host address used by the user. |
java.util.Date |
getLastLoginTime()
Returns the date of the last successful login time for a user. |
java.util.Date |
getLastPasswordChangeTime()
Gets the last password change time. |
java.util.Set |
getRoles()
Gets the roles assigned to a particular account. |
java.lang.String |
getScreenName()
Gets the screen name. |
void |
incrementFailedLoginCount()
Increment failed login count. |
boolean |
isAnonymous()
Checks if is anonymous. |
boolean |
isEnabled()
Checks if an account is currently 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()
Returns a token to be used as a prevention against CSRF attacks. |
java.lang.String |
resetRememberToken()
Returns a token to be used as a "remember me" cookie. |
void |
setAccountName(java.lang.String accountName)
Sets the account name. |
void |
setRoles(java.util.Set roles)
Sets the roles. |
void |
setScreenName(java.lang.String screenName)
Sets the screen name. |
void |
unlock()
Unlock account. |
boolean |
verifyPassword(java.lang.String password)
Verify that the supplied password matches the password for this user. |
| Field Detail |
public static final IUser ANONYMOUS
| Method Detail |
public void addRole(java.lang.String role)
throws AuthenticationException
role - the role
AuthenticationException - the authentication exception
public void addRoles(java.util.Set newRoles)
throws AuthenticationException
newRoles - 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
oldPassword - the old passwordnewPassword1 - the new password1newPassword2 - the new password2
AuthenticationException - the authentication exception
EncryptionExceptionpublic void disable()
AuthenticationException - the authentication exceptionpublic void enable()
AuthenticationException - the authentication exceptionpublic java.lang.String getAccountName()
public java.lang.String getCSRFToken()
public int getFailedLoginCount()
public java.lang.String getLastHostAddress()
public java.util.Date getLastFailedLoginTime()
throws AuthenticationException
AuthenticationException - the authentication exceptionpublic java.util.Date getLastLoginTime()
public java.util.Date getLastPasswordChangeTime()
public java.util.Set getRoles()
public java.lang.String getScreenName()
public void incrementFailedLoginCount()
public boolean isAnonymous()
public boolean isEnabled()
public boolean isExpired()
public boolean isInRole(java.lang.String role)
role - the role
public boolean isLocked()
public boolean isLoggedIn()
public boolean isSessionAbsoluteTimeout()
public boolean isSessionTimeout()
public void lock()
public void loginWithPassword(java.lang.String password)
throws AuthenticationException
password - the password
AuthenticationException - the authentication exceptionpublic void logout()
public void removeRole(java.lang.String role)
throws AuthenticationException
role - the role
AuthenticationException - the authentication exception
public java.lang.String resetCSRFToken()
throws AuthenticationException
AuthenticationException - the authentication exception
public java.lang.String resetRememberToken()
throws AuthenticationException
AuthenticationException - the authentication exceptionpublic void setAccountName(java.lang.String accountName)
accountName - the new account name
public void setRoles(java.util.Set roles)
throws AuthenticationException
roles - the new roles
AuthenticationExceptionpublic void setScreenName(java.lang.String screenName)
screenName - the new screen namepublic void unlock()
public boolean verifyPassword(java.lang.String password)
throws EncryptionException
password -
EncryptionException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||