Added LDAP Service account support for LDAP server that don't allow anon
This commit is contained in:
parent
7e0e0db384
commit
8b333c935d
|
@ -46,6 +46,16 @@ abstract class AuthController extends Controller
|
||||||
ldap_set_option($server, LDAP_OPT_NETWORK_TIMEOUT, 10);
|
ldap_set_option($server, LDAP_OPT_NETWORK_TIMEOUT, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$serviceAccountFQDN= (array_key_exists('service_account_dn', $this->config['ldap'])) ?
|
||||||
|
$this->config['ldap']['service_account_dn'] : null;
|
||||||
|
if (is_string($serviceAccountFQDN)) {
|
||||||
|
|
||||||
|
if (ldap_bind($server,$serviceAccountFQDN,$this->config['ldap']['service_account_password']) === false) {
|
||||||
|
$this->logger->error("Bind with service account ($serviceAccountFQDN) failed.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $server;
|
return $server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue