GUACAMOLE-243: Remove referall authentication parameter and just use search credentials.

This commit is contained in:
Nick Couchman
2017-10-23 20:13:17 -04:00
parent 9c99905a1d
commit 72c8308b99
3 changed files with 2 additions and 43 deletions

View File

@@ -316,6 +316,7 @@ public class ConfigurationService {
* The search filter that should be used when querying the
* LDAP server for users that are valid in Guacamole, or
* "(objectClass=*)" if not specified.
*
* @throws GuacamoleException
* If guacamole.properties cannot be parsed.
*/
@@ -326,37 +327,6 @@ public class ConfigurationService {
);
}
/**
* Returns the authentication method to use during referral following.
*
* @return
* The authentication method to use during referral following
* as configured in guacamole.properties or as derived from
* other configuration options.
*
* @throws GuacamoleException
* If guacamole.properties cannot be parsed.
*/
public String getReferralAuthentication() throws GuacamoleException {
String confMethod = environment.getProperty(
LDAPGuacamoleProperties.LDAP_REFERRAL_AUTHENTICATION
);
if (confMethod == null)
if (getSearchBindDN() != null && getSearchBindPassword() != null)
return "bind";
else
return "anonymous";
else if (confMethod.equals("bind") && (getSearchBindDN() == null || getSearchBindPassword() == null))
throw new GuacamoleException("Referral is set to bind with credentials, but credentials are not configured.");
return confMethod;
}
/**
* Returns the maximum number of seconds to wait for LDAP operations
*

View File

@@ -123,8 +123,7 @@ public class LDAPConnectionService {
// If the referral auth method is set to bind, we set it using the existing
// username and password.
String refAuthMethod = confService.getReferralAuthentication();
if (refAuthMethod != null && refAuthMethod.equals("bind"))
if (userDN != null && !userDN.isEmpty())
ldapConstraints.setReferralHandler(new ReferralAuthHandler(userDN, password));
// Set the maximum number of referrals we follow

View File

@@ -195,16 +195,6 @@ public class LDAPGuacamoleProperties {
};
/**
* Authentication method to use to follow referrals
*/
public static final StringGuacamoleProperty LDAP_REFERRAL_AUTHENTICATION = new StringGuacamoleProperty() {
@Override
public String getName() { return "ldap-referral-authentication"; }
};
/**
* Number of seconds to wait for LDAP operations to complete
*/