mirror of
https://github.com/nicolabs/ldap-plugin.git
synced 2025-09-07 05:14:24 +02:00
improved ActiveDirectory interoperability.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6494 71c3de6d-444a-0410-be80-ed276b4c234a Originally-Committed-As: 282d6c448811c859028bd91f0f8e9c9f95b56dbd
This commit is contained in:
parent
6f26969b12
commit
a05fa4f947
|
@ -99,7 +99,11 @@ public class LDAPSecurityRealm extends SecurityRealm {
|
||||||
try {
|
try {
|
||||||
DirContext ctx = LdapCtxFactory.getLdapCtxInstance("ldap://"+server+'/', new Hashtable());
|
DirContext ctx = LdapCtxFactory.getLdapCtxInstance("ldap://"+server+'/', new Hashtable());
|
||||||
Attributes atts = ctx.getAttributes("");
|
Attributes atts = ctx.getAttributes("");
|
||||||
Attribute a = atts.get("namingcontexts");
|
Attribute a = atts.get("defaultNamingContext");
|
||||||
|
if(a!=null) // this entry is available on Active Directory. See http://msdn2.microsoft.com/en-us/library/ms684291(VS.85).aspx
|
||||||
|
return a.toString();
|
||||||
|
|
||||||
|
a = atts.get("namingcontexts");
|
||||||
if(a==null) {
|
if(a==null) {
|
||||||
LOGGER.warning("namingcontexts attribute not found in root DSE of "+server);
|
LOGGER.warning("namingcontexts attribute not found in root DSE of "+server);
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue