Added LDAP Service account support for LDAP server that don't allow anon
This commit is contained in:
parent
7e0e0db384
commit
8b333c935d
1 changed files with 10 additions and 0 deletions
|
@ -45,6 +45,16 @@ abstract class AuthController extends Controller
|
|||
ldap_set_option($server, LDAP_OPT_REFERRALS, 0);
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue