org.dspace.app.webui.util
Class Authenticate

java.lang.Object
  extended by org.dspace.app.webui.util.Authenticate

public class Authenticate
extends java.lang.Object

Methods for authenticating the user. This is DSpace platform code, as opposed to the site-specific authentication code, that resides in implementations of the org.dspace.eperson.AuthenticationMethod interface.

Version:
$Revision: 5845 $
Author:
Robert Tansley

Constructor Summary
Authenticate()
           
 
Method Summary
static javax.servlet.http.HttpServletRequest getRealRequest(javax.servlet.http.HttpServletRequest request)
          Return the request that the system should be dealing with, given the request that the browse just sent.
static void loggedIn(Context context, javax.servlet.http.HttpServletRequest request, EPerson eperson)
          Store information about the current user in the request and context
static void loggedOut(Context context, javax.servlet.http.HttpServletRequest request)
          Log the user out
static void resumeInterruptedRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Resume a previously interrupted request.
static boolean startAuthentication(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Start the authentication process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Authenticate

public Authenticate()
Method Detail

getRealRequest

public static javax.servlet.http.HttpServletRequest getRealRequest(javax.servlet.http.HttpServletRequest request)
Return the request that the system should be dealing with, given the request that the browse just sent. If the incoming request is from a redirect resulting from successful authentication, a request object corresponding to the original request that prompted authentication is returned. Otherwise, the request passed in is returned.

Parameters:
request - the incoming HTTP request
Returns:
the HTTP request the DSpace system should deal with

resumeInterruptedRequest

public static void resumeInterruptedRequest(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response)
                                     throws java.io.IOException
Resume a previously interrupted request. This is invoked when a user has been successfully authenticated. The request which led to authentication will be resumed.

Parameters:
request - current HTTP request
response - HTTP response
Throws:
java.io.IOException

startAuthentication

public static boolean startAuthentication(Context context,
                                          javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Start the authentication process. This packages up the request that led to authentication being required, and then invokes the site-specific authentication method. If it returns true, the user was authenticated without any redirection (e.g. by an X.509 certificate or other implicit method) so the process that called this can continue and send its own response. A "false" result means this method has sent its own redirect.

Parameters:
context - current DSpace context
request - current HTTP request - the one that prompted authentication
response - current HTTP response
Returns:
true if authentication is already finished (implicit method)
Throws:
javax.servlet.ServletException
java.io.IOException

loggedIn

public static void loggedIn(Context context,
                            javax.servlet.http.HttpServletRequest request,
                            EPerson eperson)
Store information about the current user in the request and context

Parameters:
context - DSpace context
request - HTTP request
eperson - the eperson logged in

loggedOut

public static void loggedOut(Context context,
                             javax.servlet.http.HttpServletRequest request)
Log the user out

Parameters:
context - DSpace context
request - HTTP request


Copyright © 2010 DuraSpace. All Rights Reserved.