mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-19 07:53:08 +00:00
Merge pull request #19 from LongsightGroup/DS-1180
[DS-1180] build the DN manually instead of attempting to search with the...
This commit is contained in:
@@ -182,7 +182,19 @@ public class LDAPHierarchicalAuthentication
|
|||||||
// Get the DN of the user
|
// Get the DN of the user
|
||||||
String adminUser = ConfigurationManager.getProperty("authentication-ldap", "search.user");
|
String adminUser = ConfigurationManager.getProperty("authentication-ldap", "search.user");
|
||||||
String adminPassword = ConfigurationManager.getProperty("authentication-ldap", "search.password");
|
String adminPassword = ConfigurationManager.getProperty("authentication-ldap", "search.password");
|
||||||
String dn = ldap.getDNOfUser(adminUser, adminPassword, context, netid);
|
String objectContext = ConfigurationManager.getProperty("authentication-ldap", "object_context");
|
||||||
|
String idField = ConfigurationManager.getProperty("authentication-ldap", "id_field");
|
||||||
|
String dn = "";
|
||||||
|
|
||||||
|
// If adminUser is blank, then we can't search so assume the DN
|
||||||
|
if (StringUtils.isBlank(adminUser) || StringUtils.isBlank(adminPassword))
|
||||||
|
{
|
||||||
|
dn = idField + "=" + netid + "," + objectContext;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dn = ldap.getDNOfUser(adminUser, adminPassword, context, netid);
|
||||||
|
}
|
||||||
|
|
||||||
// Check a DN was found
|
// Check a DN was found
|
||||||
if ((dn == null) || (dn.trim().equals("")))
|
if ((dn == null) || (dn.trim().equals("")))
|
||||||
|
Reference in New Issue
Block a user