Class DefaultAuthenticationManager
- java.lang.Object
-
- org.openbravo.authentication.AuthenticationManager
-
- org.openbravo.authentication.basic.DefaultAuthenticationManager
-
public class DefaultAuthenticationManager extends AuthenticationManager
- Author:
- adrianromero, iperdomo
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openbravo.authentication.AuthenticationManager
AuthenticationManager.Stateless, AuthenticationManager.UserLoginInfo
-
-
Field Summary
-
Fields inherited from class org.openbravo.authentication.AuthenticationManager
conn, defaultServletUrl, FAILED_SESSION, localAdress, LOGIN_PARAM, loginName, PASSWORD_PARAM, STATELESS_REQUEST_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description DefaultAuthenticationManager()
DefaultAuthenticationManager(javax.servlet.http.HttpServlet s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkIfPasswordExpired(String userId, String language)
Checks the expiration password date from userId, throws AuthenticationExpirationPasswordException in case that expiration date is reachedprotected String
doAuthenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Called from the authenticate method makes the necessary processing to check if the request is authenticated or not.protected void
doLogout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Method called from the logout method after clearing all session attributes.-
Methods inherited from class org.openbravo.authentication.AuthenticationManager
authenticate, bdErrorAjax, checkUserPassword, connectorAuthenticate, connectorAuthenticate, createDBSession, createDBSession, decodeBasicAuthenticationData, doWebServiceAuthenticate, doWebServiceAuthenticate, getAuthenticationManager, getLoginURL, init, isStatelessRequest, isStatelessService, logout, markRequestAsSelfAuthenticated, updateDBSession, useExternalLoginPage, webServiceAuthenticate, webServiceAuthenticate
-
-
-
-
Constructor Detail
-
DefaultAuthenticationManager
public DefaultAuthenticationManager()
-
DefaultAuthenticationManager
public DefaultAuthenticationManager(javax.servlet.http.HttpServlet s) throws AuthenticationException
- Throws:
AuthenticationException
-
-
Method Detail
-
doAuthenticate
protected String doAuthenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AuthenticationException, javax.servlet.ServletException, IOException
Description copied from class:AuthenticationManager
Called from the authenticate method makes the necessary processing to check if the request is authenticated or not. The simplest way to check is if the #Authenticated_user session attribute is present and return it.- Specified by:
doAuthenticate
in classAuthenticationManager
- Parameters:
request
- HTTP request object, used for handling parameters and session attributes- Returns:
- The user id (AD_User_ID) if the request is already authenticated or the authentication process succeeded
- null if the request is not authenticated or authentication process failed (e.g. wrong password)
- Throws:
AuthenticationException
javax.servlet.ServletException
IOException
- See Also:
DefaultAuthenticationManager
-
doLogout
protected void doLogout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
Description copied from class:AuthenticationManager
Method called from the logout method after clearing all session attributes. The usual process is to redirect the user to the login page- Specified by:
doLogout
in classAuthenticationManager
- Parameters:
request
- HTTP request objectresponse
- HTTP response object- Throws:
javax.servlet.ServletException
IOException
-
checkIfPasswordExpired
protected void checkIfPasswordExpired(String userId, String language) throws AuthenticationExpirationPasswordException
Checks the expiration password date from userId, throws AuthenticationExpirationPasswordException in case that expiration date is reached- Parameters:
userId
- The userId of the user to check expiration password datelanguage
- Default language for the user- Throws:
AuthenticationExpirationPasswordException
- AuthenticationExpirationPasswordException is thrown in case that expiration date is reached
-
-