Package org.openbravo.base.secureApp
Class LoginHandler
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.openbravo.base.HttpBaseServlet
-
- org.openbravo.base.secureApp.LoginHandler
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
,ConnectionProvider
public class LoginHandler extends HttpBaseServlet
LoginHandler
is called fromLogin
Servlet after the user has entered user and password. It checks user/ password validity as well as license settings and decides whether the user can log in the application or not.Depending if the instance is 2.50 or 3.0 the result of this Servlet differs. 2.50 instances show the messages in a new window served by this Servlet and do the actual redirection in case of success. 3.0 instance Login Servlet call LoginHandler as an ajax request and they expect to obtain a json object with information about success or message and in this case the message to show.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
SUCCESS_SESSION_STANDARD
-
Fields inherited from class org.openbravo.base.HttpBaseServlet
globalParameters, log4j, myPool, strDefaultServlet, strDireccion, strReplaceWith, strReplaceWithFull, xmlEngine
-
-
Constructor Summary
Constructors Constructor Description LoginHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
checkLicenseAndGo(javax.servlet.http.HttpServletResponse res, VariablesSecureApp vars, String strUserAuth, String username, String sessionId)
protected void
checkLicenseAndGo(javax.servlet.http.HttpServletResponse res, VariablesSecureApp vars, String strUserAuth, String username, String sessionId, boolean doRedirect)
Deprecated.void
doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Redirects all HTTP GET requests to be handled by the doPost method of the extending class.void
doOptions(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
void
doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
String
getServletInfo()
protected String
getSessionType()
Returns how the successful session will be marked in ad_session.protected void
goToRetry(javax.servlet.http.HttpServletResponse response, VariablesSecureApp vars, String message, String title, String msgType, String action)
protected void
goToRetry(javax.servlet.http.HttpServletResponse response, VariablesSecureApp vars, String message, String title, String msgType, String action, boolean doRedirect)
Deprecated.protected boolean
isBackOfficeLogin()
Is current login for a back-office sessionprotected void
setCORSHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
Methods inherited from class org.openbravo.base.HttpBaseServlet
doGetCall, doPostCall, getBaseDesignPath, getCallableStatement, getCallableStatement, getCallableStatement, getConnection, getPoolStatus, getPreparedStatement, getPreparedStatement, getPreparedStatement, getRDBMS, getStatement, getStatement, getStatement, getStatus, getTransactionConnection, init, initialize, releaseCallableStatement, releaseCommitConnection, releasePreparedStatement, releaseRollbackConnection, releaseStatement, releaseTransactionalPreparedStatement, releaseTransactionalStatement, service, serviceInitialized
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doPut, doTrace, getLastModified, service
-
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openbravo.database.ConnectionProvider
destroy
-
-
-
-
Field Detail
-
SUCCESS_SESSION_STANDARD
public static final String SUCCESS_SESSION_STANDARD
- See Also:
- Constant Field Values
-
-
Method Detail
-
doPost
public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException, javax.servlet.ServletException
- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
IOException
javax.servlet.ServletException
-
doOptions
public void doOptions(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
- Overrides:
doOptions
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
Description copied from class:HttpBaseServlet
Redirects all HTTP GET requests to be handled by the doPost method of the extending class.- Overrides:
doGet
in classHttpBaseServlet
- Parameters:
request
- HttpServletRequest object where details of the HTTP request are.response
- HttpServletResponse object where the response will be written and returned to the user.- Throws:
IOException
javax.servlet.ServletException
-
setCORSHeaders
protected void setCORSHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletException
IOException
-
checkLicenseAndGo
@Deprecated protected final void checkLicenseAndGo(javax.servlet.http.HttpServletResponse res, VariablesSecureApp vars, String strUserAuth, String username, String sessionId, boolean doRedirect) throws IOException, javax.servlet.ServletException
Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
checkLicenseAndGo
protected final void checkLicenseAndGo(javax.servlet.http.HttpServletResponse res, VariablesSecureApp vars, String strUserAuth, String username, String sessionId) throws IOException, javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
-
isBackOfficeLogin
protected boolean isBackOfficeLogin()
Is current login for a back-office session
-
getSessionType
protected String getSessionType()
Returns how the successful session will be marked in ad_session. It can be app specific.
-
goToRetry
@Deprecated protected final void goToRetry(javax.servlet.http.HttpServletResponse response, VariablesSecureApp vars, String message, String title, String msgType, String action, boolean doRedirect) throws IOException, javax.servlet.ServletException
Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
goToRetry
protected final void goToRetry(javax.servlet.http.HttpServletResponse response, VariablesSecureApp vars, String message, String title, String msgType, String action) throws IOException, javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
-
getServletInfo
public String getServletInfo()
- Specified by:
getServletInfo
in interfacejavax.servlet.Servlet
- Overrides:
getServletInfo
in classHttpBaseServlet
-
-