Skip to content

Commit ae5be9e

Browse files
authored
AD Auth: better auth failure (librenms#18471)
Throw an AuthenticationException if we cannot search for a user (permission removed or no bind user when enabling remember me)
1 parent 6a030c2 commit ae5be9e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

LibreNMS/Authentication/ActiveDirectoryAuthorizer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ public function userExists($username, $throw_exception = false)
118118
$this->userFilter($username),
119119
['samaccountname']
120120
);
121+
122+
if ($search === false) {
123+
throw new AuthenticationException('User search failed: ' . ldap_error($connection));
124+
}
125+
121126
$entries = ldap_get_entries($connection, $search);
122127

123128
if ($entries['count']) {

0 commit comments

Comments
 (0)