public class AuthenticationUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
REQUEST_INTERRUPTED
Session attribute name for storing the return URL where the user should
be redirected too once successfully authenticated.
|
static String |
REQUEST_INTERRUPTED_CHARACTERS |
static String |
REQUEST_INTERRUPTED_HEADER
These store a message giving a reason for why the request is being interrupted.
|
static String |
REQUEST_INTERRUPTED_MESSAGE |
static String |
REQUEST_RESUME |
| Constructor and Description |
|---|
AuthenticationUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allowSetPassword(Map objectModel,
String email)
Determine if the EPerson (to be created or already created) has the
ability to set their own password.
|
static Context |
authenticate(Map objectModel,
String email,
String password,
String realm)
Authenticate the current DSpace content based upon given authentication
credentials.
|
static Context |
authenticateImplicit(Map objectModel)
Perform implicit authentication.
|
static boolean |
canSelfRegister(Map objectModel,
String email)
Determine if the email can register itself or needs to be
created by a site administrator first.
|
static EPerson |
createNewEperson(Map objectModel,
String email)
Construct a new, mostly blank, eperson for the given email address.
|
static void |
interruptRequest(Map objectModel,
String header,
String message,
String characters)
Interrupt the current request and store if for later resumption.
|
static boolean |
isInterupptedRequest(Map objectModel)
Is there a currently interrupted request?
|
static boolean |
isLoggedIn(javax.servlet.http.HttpServletRequest request)
Has this user authenticated?
|
static void |
logIn(Map objectModel,
EPerson eperson)
Log the given user in as a real authenticated user.
|
static void |
loginAs(Context context,
javax.servlet.http.HttpServletRequest request,
EPerson loginAs)
Assume the login as another user.
|
static void |
logOut(Context context,
javax.servlet.http.HttpServletRequest request)
Log the user out.
|
static String |
resumeInterruptedRequest(Map objectModel)
Set the interrupted request to a resumable state.
|
static void |
resumeLogin(Context context,
javax.servlet.http.HttpServletRequest request)
Check to see if there are any session attributes indicating a currently authenticated
user.
|
static javax.servlet.http.HttpServletRequest |
resumeRequest(javax.servlet.http.HttpServletRequest realHttpRequest)
Check to see if this request should be resumed.
|
public static final String REQUEST_INTERRUPTED
public static final String REQUEST_RESUME
public static final String REQUEST_INTERRUPTED_HEADER
public static final String REQUEST_INTERRUPTED_MESSAGE
public static final String REQUEST_INTERRUPTED_CHARACTERS
public static Context authenticate(Map objectModel, String email, String password, String realm) throws SQLException
objectModel - Cocoon's object model.email - The email credentials provided by the user.password - The password credentials provided by the user.realm - The realm credentials provided by the user.SQLExceptionpublic static Context authenticateImplicit(Map objectModel) throws SQLException
objectModel - Cocoon's object model.SQLExceptionpublic static void logIn(Map objectModel, EPerson eperson) throws SQLException
objectModel - The cocoon object model.eperson - the eperson logged inSQLExceptionpublic static void resumeLogin(Context context, javax.servlet.http.HttpServletRequest request) throws SQLException
context - DSpace contextrequest - HTTP RequestSQLExceptionpublic static void loginAs(Context context, javax.servlet.http.HttpServletRequest request, EPerson loginAs) throws SQLException, AuthorizeException
context - The current DSpace context logged in as a site administratorrequest - The real HTTP request.loginAs - Whom to login as.SQLExceptionAuthorizeException - using an I18nTransformer key as the messagepublic static void logOut(Context context, javax.servlet.http.HttpServletRequest request) throws SQLException
context - DSpace contextrequest - HTTP requestSQLExceptionpublic static boolean canSelfRegister(Map objectModel, String email) throws SQLException
objectModel - The Cocoon object modelemail - The email of the person to be registered.SQLExceptionpublic static boolean allowSetPassword(Map objectModel, String email) throws SQLException
objectModel - The Cocoon object modelemail - The email address of the EPerson.SQLExceptionpublic static EPerson createNewEperson(Map objectModel, String email) throws SQLException, AuthorizeException
objectModel - The Cocoon object model.email - The email address of the new eperson.SQLExceptionAuthorizeExceptionpublic static boolean isInterupptedRequest(Map objectModel)
objectModel - The Cocoon object Modelpublic static void interruptRequest(Map objectModel, String header, String message, String characters)
objectModel - The Cocoon object Modelheader - A message header (i18n tag)message - A message for why the request was interrupted (i18n tag)characters - An untranslated message, perhaps an error message?public static String resumeInterruptedRequest(Map objectModel)
objectModel - The Cocoon object Modelpublic static javax.servlet.http.HttpServletRequest resumeRequest(javax.servlet.http.HttpServletRequest realHttpRequest)
realHttpRequest - The current real requestpublic static boolean isLoggedIn(javax.servlet.http.HttpServletRequest request)
request - Copyright © 2014 DuraSpace. All Rights Reserved.