| com.mvnforum.auth.OnlineUserFactory
All known Subclasses: com.mvnforum.auth.OnlineUserFactoryImpl,
OnlineUserFactory | public interface OnlineUserFactory (Code) | | |
Method Summary | |
public void | ensureCorrectPassword(String loginName, String password, boolean isEncodedPassword) Ensure the login/password pair is correct.
If password is correct, nothing happen. | public OnlineUser | getAnonymousUser(HttpServletRequest request) Get the anonymous user of the system. | public OnlineUser | getAnonymousUser(GenericRequest request) | public OnlineUser | getAuthenticatedUser(HttpServletRequest request, HttpServletResponse response, String loginName, String password, boolean isEncodedPassword) Authenticate the user given its login and password (maybe in
encrypted form) and returns some basic information about it.
Optionally, some information can be stored in the request or
session to track that the user has been logged.
Parameters: request - useful to retrieve additional information toauthenticate the user. Parameters: response - a HttpServletResponse value Parameters: loginName - a String value Parameters: password - a String value Parameters: isEncodedPassword - indicate if the password to validate isalready encoded. | public OnlineUser | getAuthenticatedUser(GenericRequest request, GenericResponse response, String loginName, String password, boolean isEncodedPassword) | public String | getEncodedPassword(String loginName, String password) Get an encoded version of the user password. | public void | logout(HttpServletRequest request, HttpServletResponse response) Logout the user from the system. | public void | logout(GenericRequest request, GenericResponse response) Logout the user from the system. | public void | postLogin(HttpServletRequest request, HttpServletResponse response, OnlineUser onlineUser) This method is called after user have logined successfully. | public boolean | validatePassword(String loginName, String password, boolean isEncodedPassword) Validate if the given login password pair is valid, in that
case true will be returned. |
ensureCorrectPassword | public void ensureCorrectPassword(String loginName, String password, boolean isEncodedPassword) throws AuthenticationException(Code) | | Ensure the login/password pair is correct.
If password is correct, nothing happen. However, if the
password is not correct, an AuthenticationException will be thrown
Parameters: loginName - a String value Parameters: password - a String value Parameters: isEncodedPassword - indicate if the password to validate isalready encoded. Note that some backends may not support tovalidate against an encrypted password. exception: AuthenticationException - if an error occurs |
getAnonymousUser | public OnlineUser getAnonymousUser(HttpServletRequest request) throws DatabaseException(Code) | | Get the anonymous user of the system. The request is used to
check some parameters about the user, as its language.
Parameters: request - a HttpServletRequest value an OnlineUser value exception: DatabaseException - if an error occurs |
getAuthenticatedUser | public OnlineUser getAuthenticatedUser(HttpServletRequest request, HttpServletResponse response, String loginName, String password, boolean isEncodedPassword) throws AuthenticationException, DatabaseException(Code) | | Authenticate the user given its login and password (maybe in
encrypted form) and returns some basic information about it.
Optionally, some information can be stored in the request or
session to track that the user has been logged.
Parameters: request - useful to retrieve additional information toauthenticate the user. Parameters: response - a HttpServletResponse value Parameters: loginName - a String value Parameters: password - a String value Parameters: isEncodedPassword - indicate if the password to validate isalready encoded. Note that some backends may not support tovalidate against an encrypted password. an OnlineUser value exception: AuthenticationException - if the pair login, passwordis not valid. Note that this method will call theOnlineUserFactory.validatePassword(String,String,boolean) exception: DatabaseException - if an error occurs See Also: OnlineUserFactory.validatePassword(String,String,boolean) |
getEncodedPassword | public String getEncodedPassword(String loginName, String password)(Code) | | Get an encoded version of the user password. This can be
useful to store that password in a cookie, for example. Note
that not all backends will return encrypted passwords as this
can be considered an insecure practice.
Parameters: loginName - a String value Parameters: password - a String value the encoded password of the user or null if the backend does not support returning stored passwords. |
logout | public void logout(HttpServletRequest request, HttpServletResponse response)(Code) | | Logout the user from the system.
Parameters: request - a HttpServletRequest value Parameters: response - a HttpServletResponse value |
logout | public void logout(GenericRequest request, GenericResponse response)(Code) | | Logout the user from the system.
Parameters: request - a GenericRequest value Parameters: response - a GenericResponse value |
postLogin | public void postLogin(HttpServletRequest request, HttpServletResponse response, OnlineUser onlineUser) throws DatabaseException(Code) | | This method is called after user have logined successfully.
This method could be used to implement functions prepared for that user.
Parameters: request - a HttpServletRequest value Parameters: response - a HttpServletResponse value Parameters: onlineUser - a OnlineUser that have justed been authenticated |
validatePassword | public boolean validatePassword(String loginName, String password, boolean isEncodedPassword) throws AuthenticationException(Code) | | Validate if the given login password pair is valid, in that
case true will be returned. If the password is not
correct, false will be returned. If the user does
not exist or in case of any error, an exception will be thrown.
Parameters: loginName - a String value Parameters: password - a String value Parameters: isEncodedPassword - indicate if the password to validate isalready encoded. Note that some backends may not support tovalidate against an encrypted password. a boolean value exception: AuthenticationException - if an error occurs |
|
|