public interface AuthenticationMethod
AuthenticationManager
class for details about configuring authentication handlers.
Each authentication method provides a way to map "credentials" supplied by the client into a DSpace e-person. "Authentication" is when the credentials are compared against some sort of registry or other test of authenticity.
The DSpace instance may configure many authentication methods, in a "stack". The same credentials are passed to each method in turn until one accepts them, so each method need only attempt to interpret and validate the credentials and fail gracefully if they are not appropriate for it. The next method in the stack is then called.
AuthenticationManager| Modifier and Type | Field and Description |
|---|---|
static int |
BAD_ARGS
User or password is not appropriate for this method.
|
static int |
BAD_CREDENTIALS
User exists, but credentials (e.g. passwd) don't match.
|
static int |
CERT_REQUIRED
Not allowed to login this way without X.509 certificate.
|
static int |
NO_SUCH_USER
User not found using this method.
|
static int |
SUCCESS
Authenticated OK, EPerson has been set.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowSetPassword(Context context,
javax.servlet.http.HttpServletRequest request,
String username)
Should (or can) we allow the user to change their password.
|
int |
authenticate(Context context,
String username,
String password,
String realm,
javax.servlet.http.HttpServletRequest request)
Authenticate the given or implicit credentials.
|
boolean |
canSelfRegister(Context context,
javax.servlet.http.HttpServletRequest request,
String username)
Predicate, whether to allow new EPerson to be created.
|
int[] |
getSpecialGroups(Context context,
javax.servlet.http.HttpServletRequest request)
Get list of extra groups that user implicitly belongs to.
|
void |
initEPerson(Context context,
javax.servlet.http.HttpServletRequest request,
EPerson eperson)
Initialize a new EPerson record for a self-registered new user.
|
boolean |
isImplicit()
Predicate, is this an implicit authentication method.
|
String |
loginPageTitle(Context context)
Get title of login page to which to redirect.
|
String |
loginPageURL(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Get login page to which to redirect.
|
static final int SUCCESS
static final int BAD_CREDENTIALS
static final int CERT_REQUIRED
static final int NO_SUCH_USER
static final int BAD_ARGS
boolean canSelfRegister(Context context, javax.servlet.http.HttpServletRequest request, String username) throws SQLException
context - DSpace contextrequest - HTTP request, in case it's needed. May be null.username - Username, if available. May be null.SQLExceptionvoid initEPerson(Context context, javax.servlet.http.HttpServletRequest request, EPerson eperson) throws SQLException
context - DSpace contextrequest - HTTP request, in case it's needed. May be null.eperson - newly created EPerson record - email + information from the
registration form will have been filled out.SQLExceptionboolean allowSetPassword(Context context, javax.servlet.http.HttpServletRequest request, String username) throws SQLException
context - DSpace contextrequest - HTTP request, in case it's needed. May be null.username - Username, if available. May be null.SQLExceptionboolean isImplicit()
int[] getSpecialGroups(Context context, javax.servlet.http.HttpServletRequest request) throws SQLException
It might make sense to implement this method by itself in a separate authentication method that just adds special groups, if the code doesn't belong with any existing auth method. The stackable authentication system was designed expressly to separate functions into "stacked" methods to keep your site-specific code modular and tidy.
context - A valid DSpace context.request - The request that started this operation, or null if not
applicable.null.SQLExceptionint authenticate(Context context, String username, String password, String realm, javax.servlet.http.HttpServletRequest request) throws SQLException
EPerson. If an EPerson is found it is
set in the Context that was passed.context - DSpace context, will be modified (ePerson set) upon success.username - Username (or email address) when method is explicit. Use null for
implicit method.password - Password for explicit auth, or null for implicit method.realm - Realm is an extra parameter used by some authentication methods, leave null if
not applicable.request - The HTTP request that started this operation, or null if not applicable.Meaning:
SUCCESS - authenticated OK.
BAD_CREDENTIALS - user exists, but credentials (e.g. passwd) don't match
CERT_REQUIRED - not allowed to login this way without X.509 cert.
NO_SUCH_USER - user not found using this method.
BAD_ARGS - user/pw not appropriate for this method
SQLExceptionString loginPageURL(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
context - DSpace context, will be modified (ePerson set) upon success.request - The HTTP request that started this operation, or null if not applicable.response - The HTTP response from the servlet method.String loginPageTitle(Context context)
context - DSpace context, will be modified (ePerson set) upon success.Copyright © 2015 DuraSpace. All Rights Reserved.