Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

Login with LDAP not working

I'm trying to get the login with LDAP working, but I'm having no luck with it.

My current version:
PHP Version : 8.2.4
Web Server : Apache/2.4.56 (Debian)
Database Server : Debian 11 version 10.5.18-MariaDB-0+deb11u1
Version OCSReports: 2.11.1-nightly-2023-03-27

LDAP ist enabled in php.ini with "extension=ldap"
LDAP is enabled in var.php with "define('AUTH_TYPE', 2);"

My current settings:
CONEX_LDAP_SERVEUR= ldap://dc.company.local
CONEX_ROOT_DN= CN=ReadOnlyLDAP,OU=Passive Accounts,OU=company,DC=company,DC=local
CONEX_ROOT_PW= somepassword
CONEX_LDAP_PORT= 389
CONEX_DN_BASE_LDAP= OU=Company-Management,OU=sub-company,OU=sub-companys,OU=company,DC=company,DC=local
CONEX_LOGIN_FIELD= sAMAccountName
CONEX_LDAP_PROTOCOL_VERSION= 3
CONEX_LDAP_CHECK_DEFAULT_ROLE= Administrators
CONEX_LDAP_NB_FILTERS= 1
CONEX_LDAP_FILTER1=
CONEX_LDAP_FILTER1_ROLE= Administrators

On the webpage it's only showing a blank page after attempting to login with ldap credentials.
And I'm getting the following error message in /var/log/apache2/error.log
"[Wed Apr 19 13:08:45.182037 2023] [proxy_fcgi:error] [pid 9952] [client xxx.xxx.xxx.xxx:56080] AH01071: Got error 'PHP message: PHP Warning:  Undefined variable $filter in /var/www/html/backend/AUTH/methode/ldap.php on line 99; PHP message: PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/backend/AUTH/methode/ldap.php on line 99; PHP message: PHP Warning:  Undefined variable $filter in /var/www/html/backend/AUTH/methode/ldap.php on line 99; PHP message: PHP Warning:  ldap_bind(): Unable to bind to server: Invalid credentials in /var/www/html/backend/AUTH/methode/ldap.php on line 143; PHP message: PHP Fatal error:  Uncaught TypeError: ldap_search(): Argument #1 ($ldap) must be of type LDAP|array, bool given in /var/www/html/backend/AUTH/methode/ldap.php:102\nStack trace:\n#0 /var/www/html/backend/AUTH/methode/ldap.php(102): ldap_search()\n#1 /var/www/html/backend/AUTH/methode/ldap.php(66): search_on_loginnt()\n#2 /var/www/html/backend/AUTH/methode/ldap.php(45): verif_pw_ldap()\n#3 /var/www/html/backend/AUTH/auth.php(94): require_once('...')\n#4 /var/www/html/require/header.php(321): require_once('...')\n#5 /var/www/html/index.php(44): require('...')\n#6 {main}\n  thrown in /var/www/html/backend/AUTH/methode/ldap.php on line 102', referer: https://ocs.company.de/index.php"

For me it looks like in necessarily need a filter to get ldap working. Even though  i just want to give everyone from our managment the option to login as Administrator. And have a Super Admin as Backup, just with a local login.
in OCS Inventory NG server for Unix by (120 points)

1 Answer

0 votes
'Unable to bind to server: Invalid credentials' seems clear, no ?

Everyone as Administrator ? Are you sure ?
by (19.2k points)
 
Powered by Question2Answer
...