LDAP Authenticate returns 0
StuxNetV8 opened this issue · comments
Hey guys!
I successfully set up Librebooking and are now working on the LDAP authentication but on the page it says: "We could not match your username or password". First I checked the apache log and it says:
[Thu Sep 21 14:41:11.008071 2023] [php:warn] [pid 1037] [client IP:Port] PHP Warning: Undefined array key 1 in /var/www/html/Pages/LoginPage.php on line 122, referer: mywebsite
ldap_create
ldap_url_parse_ext(ldaps://myldapserver)
ldap_sasl_bind_s
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP myldapserver:636
ldap_new_socket: 15
ldap_prepare_socket: 15
ldap_connect_to_host: Trying IP:Port
ldap_pvt_connect: fd: 15 tm: -1 async: 0
attempting to connect:
connect success
ldap_open_defconn: successful
ldap_send_server_request
ldap_result ld 0x5629732ee300 msgid 1
wait4msg ld 0x5629732ee300 msgid 1 (infinite timeout)
wait4msg continue ld 0x5629732ee300 msgid 1 all 1ld 0x5629732ee300 Connections:
host: myldapserver port: 636 (default)
from: IP=IP:Port
refcnt: 2 status: Connected
last used: Thu Sep 21 14:41:11 2023ld 0x5629732ee300 Outstanding Requests:
msgid 1, origid 1, status InProgress
outstanding referrals 0, parent count 0
ld 0x5629732ee300 request count 1 (abandoned 0)
ld 0x5629732ee300 Response Queue:
Empty
ld 0x5629732ee300 response count 0
ldap_chkResponseList ld 0x5629732ee300 msgid 1 all 1
ldap_chkResponseList returns ld 0x5629732ee300 NULL
ldap_int_select
read1msg: ld 0x5629732ee300 msgid 1 all 1
wait4msg continue ld 0x5629732ee300 msgid 1 all 1
ld 0x5629732ee300 Connections:
host: myldapserver port: 636 (default)
from: IP=IP:Port
refcnt: 2 status: Connected
last used: Thu Sep 21 14:41:11 2023ld 0x5629732ee300 Outstanding Requests:
msgid 1, origid 1, status InProgress
outstanding referrals 0, parent count 0
ld 0x5629732ee300 request count 1 (abandoned 0)
I assume that the binding is working especially when I change something in the LDAP config librebooking return "unknown error".
So I checked librebookings app.log next and it seems like the LDAP Authenticate returns 0:
[2023-09-21T15:00:48.867513+02:00] app.INFO: [User= ()] Searching ldap for user u.ser [File=/var/www/html/plugins/Authentication/Ldap/Ldap2Wrapper.php,Line=118] [] []
[2023-09-21T15:00:48.869946+02:00] app.INFO: [User= ()] Result of LDAP Authenticate for user u.ser: 0 [File=/var/www/html/plugins/Authentication/Ldap/Ldap.php,Line=118] [] []
[2023-09-21T15:00:48.870139+02:00] app.INFO: [User= ()] Trying to log in as: u.ser [File=/var/www/html/lib/Application/Authentication/Authentication.php,Line=82] [] []
[2023-09-21T15:00:48.874599+02:00] app.INFO: [User= ()] User: u.ser, was validated: 0 [File=/var/www/html/lib/Application/Authentication/Authentication.php,Line=100] [] []
This is my Ldap.config.php:
$conf['settings']['host'] = 'ldaps://myldapserver';
$conf['settings']['port'] = '636';
$conf['settings']['version'] = '3';
$conf['settings']['starttls'] = 'false';
$conf['settings']'binddn']='CN=ldapadmin,OU=myOU,OU=LDAP,OU=Serviceaccounts,OU=Accounts,OU=OU1,DC=subdomain,DC=mydomain,DC=de'
$conf['settings']['bindpw'] = 'ldap-pw';
$conf['settings']['basedn'] = ''OU=Accounts,OU=OU1,DC=subdomain,DC=mydomain,DC=de'
$conf['settings']['filter'] = '';
$conf['settings']['scope'] = '';
$conf['settings']['required.group'] = '';
$conf['settings']['database.auth.when.ldap.user.not.found'] = 'true';
$conf['settings']['ldap.debug.enabled'] = 'true';
$conf['settings']['attribute.mapping'] = 'sn=sn,givenname=givenname,mail=mail,telephonenumber=telephonenumber,physicaldeliveryofficename=physicaldeliveryofficename,title=title';
$conf['settings']['user.id.attribute'] = 'samaccountname';
$conf['settings']['sync.groups'] = 'false';
$conf['settings']['prevent.clean.username'] = 'false';
I hope anyone can help.
Cheers!
Hi @StuxNetV8 ,
This is the same as issue #166 . Please close your issue 231 and monitor the progress of issue 166
At the moment, I think that your only quick fix is to revert to version 2.8.5.5 of Librebooking with php-7