Skip to content
Permalink
Browse files
Merge pull request #29 from fbelzunc/JENKINS-34143
[FIXED JENKINS-34143] Test Active Directory connection button reports success if the search operation doesn't have any result
  • Loading branch information
fbelzunc committed Apr 12, 2016
2 parents 313942c + a9be808 commit 8a86022e18cb81dd4bc0e7ae9afd5a8cf048d894
Showing 2 changed files with 6 additions and 1 deletion.
@@ -389,7 +389,10 @@ public FormValidation doValidate(@QueryParameter(fixEmpty = true) String domain,
DirContext context = bind(bindName, Secret.toString(password), servers);
try {
// actually do a search to make sure the credential is valid
new LDAPSearchBuilder(context, toDC(name)).searchOne("(objectClass=user)");
Attributes userAttributes = new LDAPSearchBuilder(context, toDC(name)).searchOne("(objectClass=user)");
if (userAttributes == null) {
return FormValidation.error(Messages.ActiveDirectorySecurityRealm_NoUsers());
}
} finally {
context.close();
}
@@ -3,3 +3,5 @@ DisplayName=Active Directory
GroupLookupStrategy.Auto=Automatic
GroupLookupStrategy.Recursive=Recursive group queries
GroupLookupStrategy.ChainMatch=LDAP_MATCHING_RULE_IN_CHAIN

ActiveDirectorySecurityRealm.NoUsers=The bind with the managerDn was successful but AD was not able to find any user.

0 comments on commit 8a86022

Please sign in to comment.