Skip to content

Commit

Permalink
Merge pull request #42 from fbelzunc/JENKINS-38290
Browse files Browse the repository at this point in the history
JENKINS-38290 System Property to be able to ignore referrals
  • Loading branch information
fbelzunc committed Sep 17, 2016
2 parents d6f2723 + 2f48cd2 commit eca9c9e
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -536,7 +536,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 eca9c9e

Please sign in to comment.