Skip to content

Commit 36dddd4

Browse files
authored
Update JettyCachingLdapLoginModule.java : manage Referral Control
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
1 parent c411c0a commit 36dddd4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rundeckapp/src/main/groovy/com/dtolabs/rundeck/jetty/jaas/JettyCachingLdapLoginModule.java

+9
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
* rolePrefix="rundeck"
9393
* cacheDurationMillis="500"
9494
* reportStatistics="true"
95+
* referralControl="follow"
9596
* nestedGroups="false";
9697
* };
9798
* </pre>
@@ -155,6 +156,11 @@ public class JettyCachingLdapLoginModule extends AbstractLoginModule {
155156
*/
156157
protected String _contextFactory;
157158

159+
/**
160+
* Context.REFERRAL
161+
*/
162+
protected String _referralControl = "ignore";
163+
158164
/**
159165
* root DN used to connect to
160166
*/
@@ -1067,6 +1073,7 @@ public void initializeOptions(final Map options) {
10671073
_port = Integer.parseInt((String) options.get("port"));
10681074
}
10691075
_providerUrl = (String) options.get("providerUrl");
1076+
_referralControl = (String) options.get("referralControl");
10701077
_contextFactory = (String) options.get("contextFactory");
10711078
_bindDn = (String) options.get("bindDn");
10721079
String bindPassword = attemptBindPwdFromRdkConfig();
@@ -1232,6 +1239,8 @@ public Hashtable getEnvironment() {
12321239
env.put(Context.SECURITY_CREDENTIALS, _bindPassword);
12331240
}
12341241

1242+
env.put(Context.REFERRAL, referralControl);
1243+
12351244
env.put("com.sun.jndi.ldap.read.timeout", Long.toString(_timeoutRead));
12361245
env.put("com.sun.jndi.ldap.connect.timeout", Long.toString(_timeoutConnect));
12371246

0 commit comments

Comments
 (0)