From f15bd8eeca630bce78c45490dc6d64d1d3299d6c Mon Sep 17 00:00:00 2001 From: Jonas Jonsson Date: Sat, 23 Nov 2013 10:44:23 +0100 Subject: [PATCH] Make test-button work for multidomain configurations When validating the configuration, the domain is split at ',' and each part will be validated individually. However, the actually bind will use the original domain string with ',' which doesn't work. --- .../plugins/active_directory/ActiveDirectorySecurityRealm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/hudson/plugins/active_directory/ActiveDirectorySecurityRealm.java b/src/main/java/hudson/plugins/active_directory/ActiveDirectorySecurityRealm.java index 916771da..5ad629f0 100644 --- a/src/main/java/hudson/plugins/active_directory/ActiveDirectorySecurityRealm.java +++ b/src/main/java/hudson/plugins/active_directory/ActiveDirectorySecurityRealm.java @@ -308,7 +308,7 @@ 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(domain)).searchOne("(objectClass=user)"); + new LDAPSearchBuilder(context, toDC(name)).searchOne("(objectClass=user)"); } finally { context.close(); }