org.eclipse.higgins.rp.servlet.server
Class Login

java.lang.Object
  extended by org.eclipse.higgins.rp.servlet.server.Login

public class Login
extends Object

Login This helper method will be called from the application after it has received an authentication token. The method calls the authenticate method of the protocol handler to continue processing the authentication. The authentication method of the protocol handler keeps track of authentication state and knows when to transition between states.


Constructor Summary
Login()
           
 
Method Summary
static void ContinueAuthentication(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Utility routine which continues authentication after POST.
static boolean handleInvalidRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Utility routine which detects if the current request is a valid request i.e.
static void newAuthSession(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Restarts a new Authentication session with the assumption that the protected resource is '/' Used when the login page is bookmarked etc.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Login

public Login()
Method Detail

ContinueAuthentication

public static void ContinueAuthentication(javax.servlet.http.HttpServletRequest req,
                                          javax.servlet.http.HttpServletResponse resp)
                                   throws IOException
Utility routine which continues authentication after POST. Fetches the protocol handler from session state, checks consistency and calls the handler

Parameters:
req - current request object
resp - current response object
Throws:
IOException

newAuthSession

public static void newAuthSession(javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse resp)
Restarts a new Authentication session with the assumption that the protected resource is '/' Used when the login page is bookmarked etc.

Parameters:
req - current request object
resp - current response object

handleInvalidRequest

public static boolean handleInvalidRequest(javax.servlet.http.HttpServletRequest req,
                                           javax.servlet.http.HttpServletResponse resp)
Utility routine which detects if the current request is a valid request i.e. it has a authSession which is valid, there is a map associated with this authSession identifier in the httpsession and the map contains a handler object. If any of these conditions is not true it returns false and restarts another authentication session with "/" as the protected resource. If all the conditions are true then it returns true and the application page can process the request as desired.

Parameters:
req - current request object
resp - current response object
Returns:
true if there is a authSession parameter in request AND the http session contains a map for this authSession AND that map contains a protocol handler