Fixed auth_test script does not do ldap bind (#10865)

This commit is contained in:
louis-oui
2019-11-21 19:42:22 +01:00
committed by PipoCanaja
parent 4ead80d06c
commit ee8119d890

5
scripts/auth_test.php Executable file → Normal file
View File

@@ -45,6 +45,11 @@ if (Config::get('auth_mechanism') == 'ldap' || Config::get('auth_mechanism') ==
try { try {
$authorizer = LegacyAuth::get(); $authorizer = LegacyAuth::get();
// ldap based auth we should bind before using, otherwise searches may fail due to anonymous bind
if (method_exists($authorizer, 'bind')) {
$authorizer->bind([]);
}
// AD bind tests // AD bind tests
if ($authorizer instanceof \LibreNMS\Authentication\ActiveDirectoryAuthorizer) { if ($authorizer instanceof \LibreNMS\Authentication\ActiveDirectoryAuthorizer) {
// peek inside the class // peek inside the class