public class LDAPAuthentication extends Object implements AuthenticationMethod
BAD_ARGS, BAD_CREDENTIALS, CERT_REQUIRED, NO_SUCH_USER, SUCCESS| Constructor and Description |
|---|
LDAPAuthentication() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowSetPassword(Context context,
javax.servlet.http.HttpServletRequest request,
String username)
Cannot change LDAP password through dspace, right?
|
int |
authenticate(Context context,
String netid,
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)
Let a real auth method return true if it wants.
|
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)
Nothing here, initialization is done when auto-registering.
|
boolean |
isImplicit()
Predicate, is this an implicit authentication method.
|
String |
loginPageTitle(Context context)
Returns message key for title of the "login" page, to use
in a menu showing the choice of multiple login methods.
|
String |
loginPageURL(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Get login page to which to redirect.
|
public boolean canSelfRegister(Context context, javax.servlet.http.HttpServletRequest request, String username) throws SQLException
canSelfRegister in interface AuthenticationMethodcontext - DSpace contextrequest - HTTP request, in case it's needed. May be null.username - Username, if available. May be null.SQLExceptionpublic void initEPerson(Context context, javax.servlet.http.HttpServletRequest request, EPerson eperson) throws SQLException
initEPerson in interface AuthenticationMethodcontext - 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.SQLExceptionpublic boolean allowSetPassword(Context context, javax.servlet.http.HttpServletRequest request, String username) throws SQLException
allowSetPassword in interface AuthenticationMethodcontext - DSpace contextrequest - HTTP request, in case it's needed. May be null.username - Username, if available. May be null.SQLExceptionpublic boolean isImplicit()
AuthenticationMethodisImplicit in interface AuthenticationMethodpublic int[] getSpecialGroups(Context context, javax.servlet.http.HttpServletRequest request)
AuthenticationMethodIt 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.
getSpecialGroups in interface AuthenticationMethodcontext - A valid DSpace context.request - The request that started this operation, or null if not
applicable.null.public int authenticate(Context context, String netid, String password, String realm, javax.servlet.http.HttpServletRequest request) throws SQLException
AuthenticationMethodEPerson. If an EPerson is found it is
set in the Context that was passed.authenticate in interface AuthenticationMethodcontext - DSpace context, will be modified (ePerson set) upon success.netid - 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
SQLExceptionpublic String loginPageURL(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
AuthenticationMethodloginPageURL in interface AuthenticationMethodcontext - 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.public String loginPageTitle(Context context)
loginPageTitle in interface AuthenticationMethodcontext - DSpace context, will be modified (ePerson set) upon success.Copyright © 2015 DuraSpace. All Rights Reserved.