Skip to content

Commit

Permalink
Update JettyCachingLdapLoginModule.java : manage Referral Control
Browse files Browse the repository at this point in the history
JNDI sets Manage Referral Control to ignore per default. This value prevents dynamic group usage with rundeck. Adding an option to change Manage Referral control default value allow dynamic groups usage.

- ignore : ignore referrals (default value as actually)
- follow :  automatically follow any referrals for dynamic groups

- https://docs.oracle.com/javase/tutorial/jndi/newstuff/mdsaIT.html
- pwm-project/pwm#610
  • Loading branch information
flyinva authored Feb 6, 2024
1 parent c411c0a commit 36dddd4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
* rolePrefix="rundeck"
* cacheDurationMillis="500"
* reportStatistics="true"
* referralControl="follow"
* nestedGroups="false";
* };
* </pre>
Expand Down Expand Up @@ -155,6 +156,11 @@ public class JettyCachingLdapLoginModule extends AbstractLoginModule {
*/
protected String _contextFactory;

/**
* Context.REFERRAL
*/
protected String _referralControl = "ignore";

/**
* root DN used to connect to
*/
Expand Down Expand Up @@ -1067,6 +1073,7 @@ public void initializeOptions(final Map options) {
_port = Integer.parseInt((String) options.get("port"));
}
_providerUrl = (String) options.get("providerUrl");
_referralControl = (String) options.get("referralControl");
_contextFactory = (String) options.get("contextFactory");
_bindDn = (String) options.get("bindDn");
String bindPassword = attemptBindPwdFromRdkConfig();
Expand Down Expand Up @@ -1232,6 +1239,8 @@ public Hashtable getEnvironment() {
env.put(Context.SECURITY_CREDENTIALS, _bindPassword);
}

env.put(Context.REFERRAL, referralControl);

env.put("com.sun.jndi.ldap.read.timeout", Long.toString(_timeoutRead));
env.put("com.sun.jndi.ldap.connect.timeout", Long.toString(_timeoutConnect));

Expand Down

0 comments on commit 36dddd4

Please sign in to comment.