public class JLDAPDirectoryProvider extends Object implements UserDirectoryProvider, LdapConnectionManagerConfig, ExternalUserSearchUDP, UsersShareEmailUDP, DisplayAdvisorUDP, AuthenticationIdUDP
An implementation of a Sakai UserDirectoryProvider that authenticates/retrieves users from a LDAP directory.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_ALLOW_AUTHENTICATION |
static boolean |
DEFAULT_AUTHENTICATE_WITH_PROVIDER_FIRST |
static int |
DEFAULT_BATCH_SIZE
Default LDAP maximum number of objects to query for
|
static boolean |
DEFAULT_IS_FOLLOW_REFERRALS
Default referral following behavior
|
static boolean |
DEFAULT_IS_SEARCH_ALIASES |
static boolean |
DEFAULT_IS_SECURE_CONNECTION
Default secure/unsecure LDAP connection creation behavior
|
static int |
DEFAULT_LDAP_PORT
Default LDAP connection port
|
static int |
DEFAULT_MAX_RESULT_SIZE
Default LDAP maximum number of objects in a result
|
static int |
DEFAULT_OPERATION_TIMEOUT_MILLIS
Default LDAP access timeout in milliseconds
|
static int |
DEFAULT_POOL_MAX_CONNS
Default LDAP maximum number of connections in the pool
|
static boolean |
DEFAULT_POOLING
Default LDAP use of connection pooling
|
static int |
DEFAULT_SEARCH_SCOPE
Default search scope for filters executed by
searchDirectory(String, LDAPConnection, LdapEntryMapper, String[], String, int) |
protected LdapEntryMapper |
defaultLdapEntryMapper
Defaults to an anon-inner class which handles
LDAPEntry(ies)
by passing them to mapLdapEntryOntoUserData(LDAPEntry), the
result of which is returned. |
static String |
DISPLAY_ID_PROPERTY
Property of the user object to store the display ID under
|
static String |
DISPLAY_NAME_PROPERTY
Property of the user object to store the display Name under
|
| Constructor and Description |
|---|
JLDAPDirectoryProvider() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticateUser(String userLogin,
UserEdit edit,
String password)
Authenticates the specified user login by recursively searching for
and binding to a DN below the configured base DN.
|
boolean |
authenticateWithProviderFirst(String id)
By default returns the global boolean setting configured
via
setAuthenticateWithProviderFirst(boolean). |
void |
clearCache()
Resets the internal
LdapUserData cache |
void |
destroy()
Typically called by Spring to signal bean destruction.
|
boolean |
findUserByEmail(UserEdit edit,
String email)
Locates a user directory entry using an email address
as a key.
|
Collection |
findUsersByEmail(String email,
UserFactory factory)
Find all user objects which have this email address.
|
Map<String,String> |
getAttributeMappings() |
String |
getBasePath() |
int |
getBatchSize() |
String |
getDisplayId(User user) |
String |
getDisplayName(User user) |
EidValidator |
getEidValidator()
Access the service used to verify EIDs prior to executing
searches on those values.
|
String |
getKeystoreLocation() |
String |
getKeystorePassword() |
LdapAttributeMapper |
getLdapAttributeMapper()
Access the currently assigned
LdapAttributeMapper delegate. |
LdapConnectionManager |
getLdapConnectionManager()
Access the currently assigned
LdapConnectionManager delegate. |
String |
getLdapHost() |
String |
getLdapPassword() |
int |
getLdapPort() |
String |
getLdapUser() |
int |
getMaxObjectsToQueryFor() |
int |
getMaxResultSize() |
MemoryService |
getMemoryService() |
int |
getOperationTimeout() |
int |
getPoolMaxConns() |
int |
getSearchScope()
Access the configured search scope for all filters executed by
searchDirectory(String, LDAPConnection, LdapEntryMapper, String[], String, int). |
com.novell.ldap.LDAPSocketFactory |
getSecureSocketFactory()
Assign a
LDAPSocketFactory appropriate for your
environment, e.g. |
com.novell.ldap.LDAPSocketFactory |
getSocketFactory()
The socket factory to be used when creating insecure connections.
|
boolean |
getUser(UserEdit edit)
Effectively the same as
getUserByEid(edit, edit.getEid()). |
LdapUserData |
getUserByAid(String aid,
com.novell.ldap.LDAPConnection conn) |
boolean |
getUserbyAid(String aid,
UserEdit user) |
protected LdapUserData |
getUserByEid(String eid,
com.novell.ldap.LDAPConnection conn)
Finds a user record using an
eid as an index. |
protected boolean |
getUserByEid(UserEdit userToUpdate,
String eid,
com.novell.ldap.LDAPConnection conn)
Finds a user record using an
eid as an index. |
void |
getUsers(Collection<UserEdit> users)
Similar to iterating over
users passing
each element to getUser(UserEdit), removing the
UserEdit if that method
returns false. |
void |
init()
Typically invoked by Spring to complete bean initialization.
|
protected void |
initLdapAttributeMapper()
Lazily "injects" a
LdapAttributeMapper if one
has not been assigned already. |
protected void |
initLdapConnectionManager()
Lazily "injects" a
LdapConnectionManager if one
has not been assigned already. |
boolean |
isAllowAuthentication()
Access the current global authentication "on/off"
switch.
|
boolean |
isAuthenticateWithProviderFirst()
Access the configured global return value for
authenticateWithProviderFirst(String). |
boolean |
isAutoBind()
Access the LDAP auto-bind configuration
|
boolean |
isFollowReferrals()
Access LDAP referral following configuration
|
boolean |
isPooling()
Access the LDAP pooling configuration
|
protected boolean |
isSearchableEid(String eid)
Consults the cached
EidValidator to determine if the
given User EID is searchable. |
boolean |
isSearchAliases() |
boolean |
isSecureConnection()
If
true, connect to LDAP over a secure protocol. |
protected String |
lookupUserBindDn(String eid,
com.novell.ldap.LDAPConnection conn)
Search the directory for a DN corresponding to a user's
EID.
|
protected LdapUserData |
mapLdapEntryOntoUserData(com.novell.ldap.LDAPEntry ldapEntry)
Maps attributes from the specified
LDAPEntry onto
a newly instantiated LdapUserData. |
protected void |
mapUserDataOntoUserEdit(LdapUserData userData,
UserEdit userEdit)
Maps attribites from the specified
LdapUserData onto
a UserEdit. |
protected LdapAttributeMapper |
newDefaultLdapAttributeMapper()
Factory method for default
LdapAttributeMapper instances. |
protected LdapConnectionManager |
newDefaultLdapConnectionManager()
Factory method for default
LdapConnectionManager instances. |
protected LdapUserData |
newLdapUserData()
Instantiates a
LdapUserData. |
protected String |
scrubSearchBaseDn(String searchBaseDn)
Responsible for pre-processing base DNs passed to
#searchDirectory(String, LDAPConnection, String[], String, int). |
protected String[] |
scrubSearchResultPhysicalAttributeNames(String[] searchResultPhysicalAttributeNames)
Responsible for pre-processing search result attribute names
passed to
#searchDirectory(String, LDAPConnection, String[], String, int). |
protected List<LdapUserData> |
searchDirectory(String filter,
com.novell.ldap.LDAPConnection conn,
LdapEntryMapper mapper,
String[] searchResultPhysicalAttributeNames,
String searchBaseDn,
int maxResults)
Execute a directory search using the specified filter
and connection.
|
protected Object |
searchDirectoryForSingleEntry(String filter,
com.novell.ldap.LDAPConnection conn,
LdapEntryMapper mapper,
String[] searchResultPhysicalAttributeNames,
String searchBaseDn)
Searches the directory for at most one entry matching the
specified filter.
|
List<UserEdit> |
searchExternalUsers(String criteria,
int first,
int last,
UserFactory factory)
Search for externally provided users that match this criteria in eid, email, first or last name.
|
void |
setAllowAuthentication(boolean allowAuthentication)
Access the current global authentication "on/off" switch.
|
void |
setAttributeMappings(Map<String,String> attributeMappings) |
void |
setAuthenticateAllowed(boolean authenticateAllowed)
An alias of
setAllowAuthentication(boolean) for backward
compatibility with existing customized deployments of this provider
which had already implemented this feature. |
void |
setAuthenticateWithProviderFirst(boolean authenticateWithProviderFirst)
Configure the global return value of
authenticateWithProviderFirst(String). |
void |
setAutoBind(boolean autoBind)
Configure the LDAP auto-bind configuration
param autoBind if
true connection allocation
(LdapConnectionManager.getConnection()) will include a
bind attempt |
void |
setBasePath(String basePath) |
void |
setBatchSize(int batchSize) |
void |
setEidValidator(EidValidator eidValidator)
Assign the service used to verify EIDs prior to executing
searches on those values.
|
void |
setEnableAid(boolean enableAid) |
void |
setFollowReferrals(boolean followReferrals)
Configures LDAP referral following
|
void |
setKeystoreLocation(String keystoreLocation) |
void |
setKeystorePassword(String keystorePassword) |
void |
setLdapAttributeMapper(LdapAttributeMapper ldapAttributeMapper)
Assign the
LdapAttributeMapper delegate. |
void |
setLdapConnectionManager(LdapConnectionManager ldapConnectionManager)
Assign the
LdapConnectionManager delegate. |
void |
setLdapHost(String ldapHost) |
void |
setLdapPassword(String ldapPassword) |
void |
setLdapPort(int ldapPort) |
void |
setLdapUser(String ldapUser) |
void |
setMaxObjectsToQueryFor(int maxObjectsToQueryFor) |
void |
setMaxResultSize(int maxResultSize) |
void |
setMemoryService(MemoryService memoryService) |
void |
setOperationTimeout(int operationTimeout) |
void |
setPooling(boolean pooling)
Configure the LDAP connection pooling configuration
param pooling if
true connections will be maintained
in a connection pool. |
void |
setPoolMaxConns(int poolMaxConns) |
void |
setSearchAliases(boolean searchAliases) |
void |
setSearchScope(int searchScope)
Set the configured search scope for all filters executed by
searchDirectory(String, LDAPConnection, LdapEntryMapper, String[], String, int). |
void |
setSecureConnection(boolean secureConnection)
Set to
true if LDAP connections
should occur over a secure protocol. |
void |
setSecureSocketFactory(com.novell.ldap.LDAPSocketFactory secureSocketFactory) |
void |
setSocketFactory(com.novell.ldap.LDAPSocketFactory socketFactory) |
boolean |
userExists(String eid)
Effectively the same as
getUserByEid(null,eid). |
public static final int DEFAULT_LDAP_PORT
public static final boolean DEFAULT_IS_SECURE_CONNECTION
public static final int DEFAULT_OPERATION_TIMEOUT_MILLIS
public static final boolean DEFAULT_IS_FOLLOW_REFERRALS
public static final boolean DEFAULT_IS_SEARCH_ALIASES
public static final int DEFAULT_SEARCH_SCOPE
searchDirectory(String, LDAPConnection, LdapEntryMapper, String[], String, int)public static final boolean DEFAULT_POOLING
public static final int DEFAULT_POOL_MAX_CONNS
public static final int DEFAULT_MAX_RESULT_SIZE
public static final int DEFAULT_BATCH_SIZE
public static final String DISPLAY_ID_PROPERTY
public static final String DISPLAY_NAME_PROPERTY
public static final boolean DEFAULT_ALLOW_AUTHENTICATION
public static final boolean DEFAULT_AUTHENTICATE_WITH_PROVIDER_FIRST
protected LdapEntryMapper defaultLdapEntryMapper
LDAPEntry(ies)
by passing them to mapLdapEntryOntoUserData(LDAPEntry), the
result of which is returned.public void init()
LdapConnectionManager
and LdapAttributeMapperprotected void initLdapConnectionManager()
LdapConnectionManager if one
has not been assigned already.
Implementation note: this approach to initing the connection mgr preserves forward compatibility of existing config, but config should probably be refactored to inject the appropriate config directly into the connection mgr.
protected void initLdapAttributeMapper()
LdapAttributeMapper if one
has not been assigned already.
Implementation note: this approach to initing the attrib mgr preserves forward compatibility of existing config, but config should probably be refactored to inject the appropriate config directly into the attrib mgr.
protected LdapConnectionManager newDefaultLdapConnectionManager()
LdapConnectionManager instances.
Ensures forward compatibility of existing config which
does not specify a delegate LdapConnectionManager.SimpleLdapConnectionManagerprotected LdapAttributeMapper newDefaultLdapAttributeMapper()
LdapAttributeMapper instances.
Ensures forward compatibility of existing config which
does not specify a delegate LdapAttributeMapper.LdapAttributeMapperpublic void destroy()
public void clearCache()
LdapUserData cachepublic boolean authenticateUser(String userLogin, UserEdit edit, String password)
Caching search results departs from
behavior in <= 2.3.0 versions, which removed cache entries following
authentication. If the intention is to ensure fresh user data at each
login, the most natural approach is probably to clear the cache before
executing the authentication process. At this writing, though, the
default UserDirectoryService impl
will invoke getUser(UserEdit) prior to
{authenticateUser(String, UserEdit, String)} if the Sakai's
local db does not recognize the specified EID. Therefore, clearing the
cache at in {authenticateUser(String, UserEdit, String)}
at best leads to confusing mid-session attribute changes. In the future
we may want to consider strategizing this behavior, or adding an eid
parameter to #destroyAuthentication() so cache records can
be invalidated on logout without ugly dependencies on the
SessionManager
authenticateUser in interface UserDirectoryProviderlookupUserBindDn(String, LDAPConnection)public boolean findUserByEmail(UserEdit edit, String email)
UserEdit
with directory attributes if the search is successful.
The UserEdit param is
technically optional and will be ignored if null.
All Exceptions are logged and result in
a false return, as do searches which yield
no results. (A concession to backward compat.)
findUserByEmail in interface UserDirectoryProvideredit - the UserEdit to updateemail - the search keytrue if the search
completed without error and found a directory entrypublic boolean getUser(UserEdit edit)
getUserByEid(edit, edit.getEid()).getUser in interface UserDirectoryProvider#getUserByEid(UserEdit, String)public boolean getUserbyAid(String aid, UserEdit user)
getUserbyAid in interface AuthenticationIdUDPpublic LdapUserData getUserByAid(String aid, com.novell.ldap.LDAPConnection conn)
public void getUsers(Collection<UserEdit> users)
users passing
each element to getUser(UserEdit), removing the
UserEdit if that method
returns false.
Adds search retry capability if any one lookup fails
with a directory error. Empties users and
returns if a retry exits exceptionally
getUsers in interface UserDirectoryProviderpublic boolean authenticateWithProviderFirst(String id)
setAuthenticateWithProviderFirst(boolean).authenticateWithProviderFirst in interface UserDirectoryProviderpublic boolean userExists(String eid)
getUserByEid(null,eid).#getUserByEid(UserEdit, String)protected boolean getUserByEid(UserEdit userToUpdate, String eid, com.novell.ldap.LDAPConnection conn) throws com.novell.ldap.LDAPException
eid as an index.
Updates the given UserEdit
if a directory entry is found.userToUpdate - the UserEdit
to update, may be nulleid - the user IDconn - a LDAPConnection to reuse. may be nulltrue if the directory entry was found, false if the
search returns without error but without resultscom.novell.ldap.LDAPException - if the search returns with a directory access errorgetUserByEid(String, LDAPConnection)protected LdapUserData getUserByEid(String eid, com.novell.ldap.LDAPConnection conn) throws com.novell.ldap.LDAPException
eid as an index.eid - the Sakai EID to search onconn - an optional LDAPConnectioncom.novell.ldap.LDAPException - if the search returns with a directory access errorprotected boolean isSearchableEid(String eid)
EidValidator to determine if the
given User EID is searchable. Allows any EID if no
EidValidator has been configured.eid - a user EID, possibly null or otherwise "empty"true if no EidValidator has been
set, or the result of EidValidator.isSearchableEid(String)protected String lookupUserBindDn(String eid, com.novell.ldap.LDAPConnection conn) throws com.novell.ldap.LDAPException
eid - the user's Sakai EIDconn - an optional LDAPConnectioncom.novell.ldap.LDAPException - if the directory query exits with an errorgetUserByEid(String, LDAPConnection),
LdapAttributeMapper.getUserBindDn(LdapUserData)protected Object searchDirectoryForSingleEntry(String filter, com.novell.ldap.LDAPConnection conn, LdapEntryMapper mapper, String[] searchResultPhysicalAttributeNames, String searchBaseDn) throws com.novell.ldap.LDAPException
filter - a search filterconn - an optional LDAPConnectionsearchResultPhysicalAttributeNames - searchBaseDn - LDAPEntry or null if no matchcom.novell.ldap.LDAPException - if the search exits with an errorprotected List<LdapUserData> searchDirectory(String filter, com.novell.ldap.LDAPConnection conn, LdapEntryMapper mapper, String[] searchResultPhysicalAttributeNames, String searchBaseDn, int maxResults) throws com.novell.ldap.LDAPException
LDAPEntry
to a LdapUserData, returning a List
of the latter.filter - the search filterconn - an optional LDAPConnectionmapper - result interpreter. Defaults to
defaultLdapEntryMapper if nullsearchResultPhysicalAttributeNames - attributes to retrieve.
May be null, in which case defaults to
LdapAttributeMapper.getSearchResultAttributes().searchBaseDn - base DN from which to begin search.
May be null, in which case defaults to assigned
basePathmaxResults - maximum number of retrieved LDAP objects. Ignored
if <= 0List if no results. Will not return nullcom.novell.ldap.LDAPException - if thrown by the searchRuntimeExction - wrapping any non-LDAPException Exceptionprotected String scrubSearchBaseDn(String searchBaseDn)
#searchDirectory(String, LDAPConnection, String[], String, int).
As implemented, simply checks for a null reference,
in which case it returns the currently cached "basePath". Otherwise
returns the received String as is.searchBaseDn - a proposed base DN. May be nullnull. Return
value may be null if no default base DN has been configuredsetBasePath(String)protected String[] scrubSearchResultPhysicalAttributeNames(String[] searchResultPhysicalAttributeNames)
#searchDirectory(String, LDAPConnection, String[], String, int).
If the given String[]> is null,
will use LdapAttributeMapper.getSearchResultAttributes().
If that method returns null will return an empty
String[]>. Otherwise returns the received String[]>
as-is.searchResultPhysicalAttributeNames - protected LdapUserData mapLdapEntryOntoUserData(com.novell.ldap.LDAPEntry ldapEntry)
LDAPEntry onto
a newly instantiated LdapUserData. Implemented to
delegate to the currently assigned LdapAttributeMapper.ldapEntry - a non-null directory entry to mapLdapUserData, populated with directory
attributesLdapAttributeMapper.mapLdapEntryOntoUserData(LDAPEntry, LdapUserData)protected LdapUserData newLdapUserData()
LdapUserData. This method exists primarily for
overriding in test cases.LdapUserDataprotected void mapUserDataOntoUserEdit(LdapUserData userData, UserEdit userEdit)
LdapUserData onto
a UserEdit. Implemented to
delegate to the currently assigned LdapAttributeMapper.userData - a non-null user cache entryuserEdit - a non-null user domain objectLdapAttributeMapper.mapUserDataOntoUserEdit(LdapUserData, UserEdit)public String getLdapHost()
getLdapHost in interface LdapConnectionManagerConfigpublic void setLdapHost(String ldapHost)
setLdapHost in interface LdapConnectionManagerConfigldapHost - The LDAP host address or name.public int getLdapPort()
getLdapPort in interface LdapConnectionManagerConfigpublic void setLdapPort(int ldapPort)
setLdapPort in interface LdapConnectionManagerConfigldapPort - The LDAP connection port to set.public String getLdapUser()
getLdapUser in interface LdapConnectionManagerConfigpublic void setLdapUser(String ldapUser)
setLdapUser in interface LdapConnectionManagerConfigldapUser - The user to bind to LDAP as, typically a manager acct,
leave blank for anonymous.public String getLdapPassword()
getLdapPassword in interface LdapConnectionManagerConfigLdapConnectionManagerConfig.getLdapUser()public void setLdapPassword(String ldapPassword)
setLdapPassword in interface LdapConnectionManagerConfigldapPassword - the LDAP password corresponding to the
current default bind-as user.public boolean isSecureConnection()
true, connect to LDAP over a secure protocol.isSecureConnection in interface LdapConnectionManagerConfigpublic void setSecureConnection(boolean secureConnection)
true if LDAP connections
should occur over a secure protocol.setSecureConnection in interface LdapConnectionManagerConfigpublic String getKeystoreLocation()
getKeystoreLocation in interface LdapConnectionManagerConfigpublic void setKeystoreLocation(String keystoreLocation)
setKeystoreLocation in interface LdapConnectionManagerConfigkeystoreLocation - the location of an SSL keystorepublic String getKeystorePassword()
getKeystorePassword in interface LdapConnectionManagerConfigpublic void setKeystorePassword(String keystorePassword)
setKeystorePassword in interface LdapConnectionManagerConfigpublic com.novell.ldap.LDAPSocketFactory getSecureSocketFactory()
LDAPSocketFactory appropriate for your
environment, e.g. LDAPJSSESecureSocketFactory
or LDAPJSSEStartTLSFactory. This
factory will only be used if LdapConnectionManagerConfig.isSecureConnection()
returns truegetSecureSocketFactory in interface LdapConnectionManagerConfigpublic void setSecureSocketFactory(com.novell.ldap.LDAPSocketFactory secureSocketFactory)
setSecureSocketFactory in interface LdapConnectionManagerConfigpublic com.novell.ldap.LDAPSocketFactory getSocketFactory()
LdapConnectionManagerConfig.isSecureConnection() returns
false. Can return null if no socket factory
needs to be used.getSocketFactory in interface LdapConnectionManagerConfigpublic void setSocketFactory(com.novell.ldap.LDAPSocketFactory socketFactory)
setSocketFactory in interface LdapConnectionManagerConfigsocketFactory - the socketFactory to use.public String getBasePath()
public void setBasePath(String basePath)
public int getOperationTimeout()
getOperationTimeout in interface LdapConnectionManagerConfigpublic void setOperationTimeout(int operationTimeout)
setOperationTimeout in interface LdapConnectionManagerConfigoperationTimeout - the directory operation timeout to set.public Map<String,String> getAttributeMappings()
public void setAttributeMappings(Map<String,String> attributeMappings)
attributeMappings - LDAP attribute map, keys are logical names,
values are physical names. may be nullpublic boolean isFollowReferrals()
isFollowReferrals in interface LdapConnectionManagerConfigtrue, directory accesses will
follow referralspublic void setFollowReferrals(boolean followReferrals)
setFollowReferrals in interface LdapConnectionManagerConfigfollowReferrals - if true, directory
accesses will follow referralspublic boolean isAutoBind()
isAutoBind in interface LdapConnectionManagerConfigtrue connection allocation
(LdapConnectionManager.getConnection()) will include a
bind attemptpublic void setAutoBind(boolean autoBind)
true connection allocation
(LdapConnectionManager.getConnection()) will include a
bind attemptsetAutoBind in interface LdapConnectionManagerConfigpublic boolean isPooling()
isPooling in interface LdapConnectionManagerConfigtrue connections will be maintained in a
connection pool.public void setPooling(boolean pooling)
true connections will be maintained
in a connection pool. This automatically sets autoBind to true as
wellsetPooling in interface LdapConnectionManagerConfigpublic int getPoolMaxConns()
getPoolMaxConns in interface LdapConnectionManagerConfigpublic void setPoolMaxConns(int poolMaxConns)
setPoolMaxConns in interface LdapConnectionManagerConfigpoolMaxConns - The maximum number of physical connections in the poolpublic int getMaxObjectsToQueryFor()
getMaxObjectsToQueryFor in interface LdapConnectionManagerConfigpublic void setMaxObjectsToQueryFor(int maxObjectsToQueryFor)
setMaxObjectsToQueryFor in interface LdapConnectionManagerConfigmaxObjectsToQueryFor - The maximum number objects to lookup in one query.public int getBatchSize()
getBatchSize in interface LdapConnectionManagerConfigpublic void setBatchSize(int batchSize)
setBatchSize in interface LdapConnectionManagerConfigbatchSize - The maximum number objects to lookup in one query.public void setEnableAid(boolean enableAid)
setEnableAid in interface LdapConnectionManagerConfigenableAid - If true then perform searches for users by Authentication ID.public int getMaxResultSize()
getMaxResultSize in interface LdapConnectionManagerConfigpublic void setMaxResultSize(int maxResultSize)
setMaxResultSize in interface LdapConnectionManagerConfigmaxResultSize - The maximum number of results to ever get back from LDAP.public LdapConnectionManager getLdapConnectionManager()
LdapConnectionManager delegate.
This delegate handles LDAPConnection allocation.LdapConnectionManager. May be
null if init() has not been called yet.public void setLdapConnectionManager(LdapConnectionManager ldapConnectionManager)
LdapConnectionManager delegate. This
delegate handles LDAPConnection allocation.ldapConnectionManager - a LdapConnectionManager.
may be nullpublic LdapAttributeMapper getLdapAttributeMapper()
LdapAttributeMapper delegate.
This delegate handles LDAP attribute mappings and encapsulates filter
writing.LdapAttributeMapper. May be
null if init() has not been called yet.public void setLdapAttributeMapper(LdapAttributeMapper ldapAttributeMapper)
LdapAttributeMapper delegate. This delegate
handles LDAP attribute mappings and encapsulates filter
writing.ldapAttributeMapper - a LdapAttributeMapper.
may be nullpublic EidValidator getEidValidator()
EidValidator or null if no
such dependency has been configuredisSearchableEid(String)public void setEidValidator(EidValidator eidValidator)
null
indicating that all EIDs are searchable.eidValidator - an EidValidator or null
to indicate that all EIDs are searchable.public boolean isAllowAuthentication()
setAllowAuthentication(boolean)public void setAllowAuthentication(boolean allowAuthentication)
false completely disables
authenticateUser(String, UserEdit, String) (regardless of
the value returned from
authenticateWithProviderFirst(String)). true
enables the authenticateUser(String, UserEdit, String)
algorithm. To simply authenticate all users without
checking credentials, e.g. in a test environment, consider overriding
authenticateUser(String, UserEdit, String) altogether.
Defaults to DEFAULT_ALLOW_AUTHENTICATION
allowAuthentication - public void setAuthenticateAllowed(boolean authenticateAllowed)
setAllowAuthentication(boolean) for backward
compatibility with existing customized deployments of this provider
which had already implemented this feature.authenticateAllowed - public boolean isAuthenticateWithProviderFirst()
authenticateWithProviderFirst(String). See
setAuthenticateWithProviderFirst(boolean) for
additional semantics.public void setAuthenticateWithProviderFirst(boolean authenticateWithProviderFirst)
authenticateWithProviderFirst(String). Be aware that
future development may expose a first-class extension point
for custom implementations of authenticateWithProviderFirst(String),
in which case the value configured here will be treated as a default
rather than an override.authenticateWithProviderFirst - public String getDisplayId(User user)
getDisplayId in interface DisplayAdvisorUDPpublic String getDisplayName(User user)
getDisplayName in interface DisplayAdvisorUDPpublic int getSearchScope()
searchDirectory(String, LDAPConnection, LdapEntryMapper, String[], String, int).
int value corresponds to a constant in LDAPConnection:
SCOPE_BASE = 0, SCOPE_ONE = 1, SCOPE_SUB = 2. Defaults to
DEFAULT_SEARCH_SCOPE.public void setSearchScope(int searchScope)
throws IllegalArgumentException
searchDirectory(String, LDAPConnection, LdapEntryMapper, String[], String, int).
ValidatedsearchScope - IllegalArgumentException - if given scope value is invalidpublic MemoryService getMemoryService()
public void setMemoryService(MemoryService memoryService)
public List<UserEdit> searchExternalUsers(String criteria, int first, int last, UserFactory factory)
Returns a List of UserEdit objects. This list will be empty if no results are returned or null
if your external provider does not implement this interface.
The list will also be null if the LDAP server returns an error, for example an '(11) Administrative Limit Exceeded'
or '(4) Sizelimit Exceeded', due to a search term being too broad and returning too many results.
See LdapAttributeMapper.getFindUserByCrossAttributeSearchFilter for the filter used.
searchExternalUsers in interface ExternalUserSearchUDPcriteria - The search criteria.first - The first record position to return. LDAP does not support paging so this value is unused.last - The last record position to return. LDAP does not support paging so this value is unused.factory - Use this factory's newUser() method to create the UserEdit objects you populate and return in the List.public Collection findUsersByEmail(String email, UserFactory factory)
findUsersByEmail in interface UsersShareEmailUDPemail - The email address string.factory - To create all the UserEdit objects you populate and return in the return collection.public boolean isSearchAliases()
public void setSearchAliases(boolean searchAliases)
Copyright © 2003–2022 Sakai Project. All rights reserved.