|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.owasp.esapi.reference.AbstractAuthenticator
public abstract class AbstractAuthenticator
A partial implementation of the Authenticator interface. This class should not implement any methods that would be meant to modify a User object, since that's probably implementation specific.
Field Summary | |
---|---|
protected static java.lang.String |
USER
Key for user in session |
Constructor Summary | |
---|---|
AbstractAuthenticator()
|
Method Summary | |
---|---|
void |
clearCurrent()
Clears the current User. |
boolean |
exists(java.lang.String accountName)
Determine if the account exists. |
User |
getCurrentUser()
Returns the currently logged in User. |
protected DefaultUser |
getUserFromRememberToken()
Returns the user if a matching remember token is found, or null if the token is missing, token is corrupt, token is expired, account name does not match and existing account, or hashed password does not match user's hashed password. |
protected User |
getUserFromSession()
Gets the user from session. |
User |
login()
Calls login with the *current* request and response. |
User |
login(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This method should be called for every HTTP request, to login the current user either from the session of HTTP request. |
void |
logout()
Logs out the current user. |
void |
setCurrentUser(User user)
Sets the currently logged in User. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.owasp.esapi.Authenticator |
---|
changePassword, createUser, generateStrongPassword, generateStrongPassword, getUser, getUser, getUserNames, hashPassword, removeUser, verifyAccountNameStrength, verifyPassword, verifyPasswordStrength |
Field Detail |
---|
protected static final java.lang.String USER
Constructor Detail |
---|
public AbstractAuthenticator()
Method Detail |
---|
public void clearCurrent()
clearCurrent
in interface Authenticator
public boolean exists(java.lang.String accountName)
exists
in interface Authenticator
accountName
- the account name
public User getCurrentUser()
getCurrentUser
in interface Authenticator
protected User getUserFromSession()
protected DefaultUser getUserFromRememberToken()
public User login() throws AuthenticationException
login
in interface Authenticator
User
if login is successful.
AuthenticationException
HTTPUtilities.setCurrentHTTP(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public User login(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AuthenticationException
login
in interface Authenticator
request
- the current HTTP requestresponse
- the HTTP response
AuthenticationException
- if the credentials are not verified, or if the account is disabled, locked, expired, or timed outpublic void logout()
logout
in interface Authenticator
public void setCurrentUser(User user)
setCurrentUser
in interface Authenticator
user
- the user to set as the current user
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |