Skip to content
Permalink
Browse files
JENKINS-38290 System Property to be able to ignore referrals
  • Loading branch information
fbelzunc committed Sep 16, 2016
1 parent d6bb427 commit 2f48cd2f5a818664b4f424e5a6a2873babf58605
Showing 1 changed file with 10 additions and 1 deletion.
@@ -514,7 +514,16 @@ public DirContext bind(String principalName, String password, List<SocketInfo> l
// as opposed to "joe@europe",
// but the bind operation doesn't appear to allow me to do so.
Hashtable<String, String> newProps = new Hashtable<String, String>();
newProps.put(Context.REFERRAL, "follow");

// Sometimes might be useful to ignore referral. Use this System property is under the user risk
Boolean ignoreReferrals = Boolean.valueOf(System.getProperty("hudson.plugins.active_directory.referral.ignore", "false"));

if (!ignoreReferrals) {
newProps.put(Context.REFERRAL, "follow");
} else {
newProps.put(Context.REFERRAL, "ignore");
}

newProps.put("java.naming.ldap.attributes.binary","tokenGroups objectSid");
newProps.put("java.naming.ldap.factory.socket",TrustAllSocketFactory.class.getName());
newProps.putAll(props);

0 comments on commit 2f48cd2

Please sign in to comment.