public class AuthenticationUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
REQUEST_INTERRUPTED
Session attribute name for storing the return URL where the user should
be redirected too once successfully authenticated.
|
static java.lang.String |
REQUEST_INTERRUPTED_CHARACTERS |
static java.lang.String |
REQUEST_INTERRUPTED_HEADER
These store a message giving a reason for why the request is being interrupted.
|
static java.lang.String |
REQUEST_INTERRUPTED_MESSAGE |
static java.lang.String |
REQUEST_RESUME |
| Constructor and Description |
|---|
AuthenticationUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allowSetPassword(java.util.Map objectModel,
java.lang.String email)
Determine if the EPerson (to be created or already created) has the
ability to set their own password.
|
static Context |
authenticate(java.util.Map objectModel,
java.lang.String email,
java.lang.String password,
java.lang.String realm)
Authenticate the current DSpace content based upon given authentication
credentials.
|
static Context |
authenticateImplicit(java.util.Map objectModel)
Perform implicit authentication.
|
static boolean |
canSelfRegister(java.util.Map objectModel,
java.lang.String email)
Determine if the email can register itself or needs to be
created by a site administrator first.
|
static EPerson |
createNewEperson(java.util.Map objectModel,
java.lang.String email)
Construct a new, mostly blank, eperson for the given email address.
|
static void |
interruptRequest(java.util.Map objectModel,
java.lang.String header,
java.lang.String message,
java.lang.String characters)
Interrupt the current request and store if for later resumption.
|
static boolean |
isInterupptedRequest(java.util.Map objectModel)
Is there a currently interrupted request?
|
static boolean |
isLoggedIn(javax.servlet.http.HttpServletRequest request)
Has this user authenticated?
|
static void |
logIn(java.util.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 java.lang.String |
resumeInterruptedRequest(java.util.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 java.lang.String REQUEST_INTERRUPTED
public static final java.lang.String REQUEST_RESUME
public static final java.lang.String REQUEST_INTERRUPTED_HEADER
public static final java.lang.String REQUEST_INTERRUPTED_MESSAGE
public static final java.lang.String REQUEST_INTERRUPTED_CHARACTERS
public static Context authenticate(java.util.Map objectModel, java.lang.String email, java.lang.String password, java.lang.String realm) throws java.sql.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.java.sql.SQLExceptionpublic static Context authenticateImplicit(java.util.Map objectModel) throws java.sql.SQLException
objectModel - Cocoon's object model.java.sql.SQLExceptionpublic static void logIn(java.util.Map objectModel,
EPerson eperson)
throws java.sql.SQLException
objectModel - The cocoon object model.eperson - the eperson logged injava.sql.SQLExceptionpublic static void resumeLogin(Context context, javax.servlet.http.HttpServletRequest request) throws java.sql.SQLException
context - DSpace contextrequest - HTTP Requestjava.sql.SQLExceptionpublic static void loginAs(Context context, javax.servlet.http.HttpServletRequest request, EPerson loginAs) throws java.sql.SQLException, AuthorizeException
context - The current DSpace context logged in as a site administratorrequest - The real HTTP request.loginAs - Whom to login as.java.sql.SQLExceptionAuthorizeException - using an I18nTransformer key as the messagepublic static void logOut(Context context, javax.servlet.http.HttpServletRequest request) throws java.sql.SQLException
context - DSpace contextrequest - HTTP requestjava.sql.SQLExceptionpublic static boolean canSelfRegister(java.util.Map objectModel,
java.lang.String email)
throws java.sql.SQLException
objectModel - The Cocoon object modelemail - The email of the person to be registered.java.sql.SQLExceptionpublic static boolean allowSetPassword(java.util.Map objectModel,
java.lang.String email)
throws java.sql.SQLException
objectModel - The Cocoon object modelemail - The email address of the EPerson.java.sql.SQLExceptionpublic static EPerson createNewEperson(java.util.Map objectModel, java.lang.String email) throws java.sql.SQLException, AuthorizeException
objectModel - The Cocoon object model.email - The email address of the new eperson.java.sql.SQLExceptionAuthorizeExceptionpublic static boolean isInterupptedRequest(java.util.Map objectModel)
objectModel - The Cocoon object Modelpublic static void interruptRequest(java.util.Map objectModel,
java.lang.String header,
java.lang.String message,
java.lang.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 java.lang.String resumeInterruptedRequest(java.util.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.