librenms / librenms

Community-based GPL-licensed network monitoring system
https://www.librenms.org
Other
3.94k stars 2.31k forks source link

Failed to authenticate to LibreNMS via LDAP #15760

Closed Rodrigus189 closed 4 months ago

Rodrigus189 commented 10 months ago

The problem

Hello everyone, I'm trying to authenticate LDAP users to LibreNMS and I'm getting an error when trying, I'm going to leave the error in the log box. Through the web interface I receive a message like "bind success" and when executing the auth_teste.php script, I receive the same message, but informing that the credentials are invalid. But they're not, I followed the same configuration pattern as other environments I have and it's working, only in Libre it doesn't work.

Output of ./validate.php

[OK]    Composer Version: 2.6.6
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]    Database and column collations are correct
[OK]    Database schema correct
[OK]    MySQL and PHP time match
[OK]    Active pollers found
[OK]    Dispatcher Service not detected
[OK]    Locks are functional
[OK]    Python poller wrapper is polling
[OK]    Redis is unavailable
[OK]    rrd_dir is writable
[OK]    rrdtool version ok

What was the last working version of LibreNMS?

No response

Anything in the logs that might be useful for us?

ldap_get_entries(): Argument #2 ($result) must be of type LDAP\Result, bool given {"exception":"[object] (TypeError(code: 0): ldap_get_entries(): Argument #2 ($result) must be of type LDAP\\Result, bool given at /opt/librenms/LibreNMS/Authentication/LdapAuthorizer.php:160)"}
ottorei commented 10 months ago

The ldap_get_entries function returns false when the query fails. Are you sure your the search filter is correct here?

rudybroersma commented 9 months ago

I'd just like to comment that we are using LDAP authentication with LibreNMS against Microsoft AD and it works fine. Your issue is most likely a configuration issue.