Fix javax.naming.PartialResultException: Unprocessed Continuation
Reference(s) using ldap authentication Change-Id: Ibbae91747979be8ddbe01ce1977f3a194fa210db
This commit is contained in:
@@ -1086,6 +1086,16 @@ _(Optional)_ Password for the user identified by `ldap.username`.
|
||||
If not set, an anonymous (or passwordless) connection to the LDAP
|
||||
server is attempted.
|
||||
|
||||
[[ldap.referral]]ldap.referral::
|
||||
+
|
||||
_(Optional)_ How an LDAP referral should be handled if it is
|
||||
encountered during directory traversal. Set to `follow` to
|
||||
automatically follow any referrals, or `ignore` to stop and fail
|
||||
with `javax.naming.PartialResultException: Unprocessed Continuation
|
||||
Reference(s)`
|
||||
+
|
||||
By default, `ignore`.
|
||||
|
||||
[[ldap.accountBase]]ldap.accountBase::
|
||||
+
|
||||
Root of the tree containing all user accounts. This is typically
|
||||
|
@@ -74,6 +74,7 @@ class LdapRealm implements Realm {
|
||||
private final String server;
|
||||
private final String username;
|
||||
private final String password;
|
||||
private final String referral;
|
||||
private final boolean sslVerify;
|
||||
|
||||
private final AuthConfig authConfig;
|
||||
@@ -105,6 +106,7 @@ class LdapRealm implements Realm {
|
||||
this.server = required(config, "server");
|
||||
this.username = optional(config, "username");
|
||||
this.password = optional(config, "password");
|
||||
this.referral = optional(config, "referral");
|
||||
this.sslVerify = config.getBoolean("ldap", "sslverify", true);
|
||||
this.readOnlyAccountFields = new HashSet<Account.FieldName>();
|
||||
|
||||
@@ -467,6 +469,7 @@ class LdapRealm implements Realm {
|
||||
env.put(Context.SECURITY_AUTHENTICATION, "simple");
|
||||
env.put(Context.SECURITY_PRINCIPAL, username);
|
||||
env.put(Context.SECURITY_CREDENTIALS, password != null ? password : "");
|
||||
env.put(Context.REFERRAL, referral != null ? referral : "ignore");
|
||||
}
|
||||
return new InitialDirContext(env);
|
||||
}
|
||||
@@ -477,6 +480,7 @@ class LdapRealm implements Realm {
|
||||
env.put(Context.SECURITY_AUTHENTICATION, "simple");
|
||||
env.put(Context.SECURITY_PRINCIPAL, dn);
|
||||
env.put(Context.SECURITY_CREDENTIALS, password != null ? password : "");
|
||||
env.put(Context.REFERRAL, referral != null ? referral : "ignore");
|
||||
try {
|
||||
return new InitialDirContext(env);
|
||||
} catch (NamingException e) {
|
||||
|
Reference in New Issue
Block a user