Skip to content

Commit

Permalink
JENKINS-38290 System Property to be able to ignore referrals
Browse files Browse the repository at this point in the history
  • Loading branch information
fbelzunc committed Sep 16, 2016
1 parent d6bb427 commit 2f48cd2
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -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);
Expand Down

0 comments on commit 2f48cd2

Please sign in to comment.