protected function validateConfiguration(array $config) : bool
    {
        if (!is_array($config)) {
            throw new DatabaseConnectionException('Could not load LDAP configuration settings.');
        }
        $config_keys = array_keys($config);
        $missing = array_diff(['server', 'port', 'domain', 'base_dn', 'username', 'password'], $config_keys);
        if (count($missing) > 0) {
            throw new DatabaseConnectionException('LDAP configuration missing ' . implode(', ', $missing));
        }
        return true;
    }