I'm working on integrating Znuny 7.1.6 (installed manually in `/opt/znuny`, running on Debian 12 with Apache 2.4 and mod_perl) with our Active Directory using LDAP.
Our environment:
- Znuny 7.1.3 (manual install)
- Debian 12
- Apache 2.4.62 with mod_perl
- MariaDB backend
- Active Directory functional (confirmed with `ldapsearch`)
- Customer accounts should authenticate via AD (with optional fallback to local DB)
What is working:
- Agent login (`index.pl`) works perfectly via LDAP.
- When an agent logs in for the first time, their account is auto-created in the database and linked correctly.
- Customer login (`customer.pl`) works **only** if authentication is set to DB-only.
- LDAP queries (via `ldapsearch`) return correct attributes for `sAMAccountName`, `givenName`, `sn`, and `mail`.
- We’ve tested fallback authentication successfully — it works as expected with local DB if LDAP fails.
What is NOT working:
- When `customer.pl` is configured with `Customer::AuthModule = LDAP` and a proper `CustomerUser` backend (LDAP), authentication succeeds, **but the user is not found in the backend**, even though `ldapsearch` confirms the data is present.
- We receive the message:
“Authentication OK but no customer record found in the backend. Please contact the administrator.”
- Log messages like the following appear:
No such user 'mauro.filho'!
- We created test scripts (using `$Kernel::OM`) and confirmed that `CustomerUser->CustomerUserDataGet()` returns empty for the same user.
We have thoroughly reviewed:
- The LDAP `BaseDN`, filters, and credentials
- `CustomerKey` and `CustomerID` fields
- UTF-8 compatibility (OU has special characters like `serviço`)
- Different combinations of fallback, syncing, and direct DB entries
- Using `CustomerUser::CreateAfterAuth = 1`
- Minimal `Config.pm` with only `CustomerUser::LDAP` active
But still: authentication is successful, yet `customer.pl` cannot match the user in the LDAP backend.
I’ve also confirmed that the LDAP entry for the user contains:
- `sAMAccountName: mauro.filho`
- `givenName`, `sn`, `mail`, and even `company`
My question is:
I'll be happy to share my full `Config.pm` or any logs if needed.
Thanks in advance!
Best regards,
Mauro