public LdapNetworkConnection bindAs(LDAPConfiguration config,
            String bindUser, String password) throws GuacamoleException {
        return bindAs(createLDAPConnection(config), bindUser, password);
    }
Binds to the LDAP server using the provided user DN and password. The
hostname, port, and encryption method of the LDAP server are determined
from guacamole.properties.

@param config
    The configuration of the LDAP server being queried.

@param bindUser
    The DN or UPN of the user to bind as, or null to bind anonymously.

@param password
    The password to use when binding as the specified user, or null to
    attempt to bind without a password.

@return
    A bound LDAP connection, or null if the connection could not be
    bound.

@throws GuacamoleException
    If an error occurs while parsing guacamole.properties, or if the
    configured encryption method is actually not implemented (a bug).
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java