phpLDAPadmin icon indicating copy to clipboard operation
phpLDAPadmin copied to clipboard

Does not work with openldap

Open xkill opened this issue 1 year ago • 8 comments

Describe the bug Cannot login using openldap

Version of PLA 2.1.3

To Reproduce Steps to reproduce the behavior:

  1. Follow instructions on https://github.com/leenooks/phpLDAPadmin.wiki.git
  2. Also create the APP_KEY
  3. My .env
APP_NAME=Laravel
APP_ENV=production
APP_KEY=base64:****
APP_DEBUG=false
APP_URL=https://****/phpldapadmin

LOG_CHANNEL=daily

CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

LDAP_HOST=ldap.****
LDAP_BASE_DN="dc=****,dc=****"
LDAP_USERNAME="uid=ldapadmin,dc=****,dc=****"
LDAP_PASSWORD="****"
LDAP_CACHE=false

Expected behavior I can login

Screenshots Image

Logs from slapd (auth succcesful)

2025-05-09T19:53:37.585505+00:00 ldap slapd[2939]: conn=1034 fd=14 ACCEPT from IP=192.168.3.17:45082 (IP=0.0.0.0:389)
2025-05-09T19:53:37.585664+00:00 ldap slapd[2939]: conn=1034 op=0 BIND dn="uid=ldapadmin,dc=****,dc=****" method=128
2025-05-09T19:53:37.585741+00:00 ldap slapd[2939]: conn=1034 op=0 BIND dn="uid=ldapadmin,dc=****,dc=****" mech=SIMPLE bind_ssf=0 ssf=0
2025-05-09T19:53:37.585769+00:00 ldap slapd[2939]: conn=1034 op=0 RESULT tag=97 err=0 qtime=0.000005 etime=0.000130 text=
2025-05-09T19:53:37.586019+00:00 ldap slapd[2939]: conn=1034 op=1 SRCH base="" scope=0 deref=0 filter="(objectClass=*)"
2025-05-09T19:53:37.586094+00:00 ldap slapd[2939]: conn=1034 op=1 SRCH attr=objectguid + *
2025-05-09T19:53:37.586174+00:00 ldap slapd[2939]: conn=1034 op=1 SEARCH RESULT tag=101 err=0 qtime=0.000007 etime=0.000135 nentries=1 text=
2025-05-09T19:53:37.586694+00:00 ldap slapd[2939]: conn=1034 op=2 SRCH base="dc=****,dc=****" scope=2 deref=0 filter="(uid=ldapadmin)"
2025-05-09T19:53:37.586736+00:00 ldap slapd[2939]: conn=1034 op=2 SRCH attr=entryuuid *
2025-05-09T19:53:37.586778+00:00 ldap slapd[2939]: conn=1034 op=2 SEARCH RESULT tag=101 err=0 qtime=0.000006 etime=0.000064 nentries=1 text=
2025-05-09T19:53:37.587635+00:00 ldap slapd[2939]: conn=1034 op=3 BIND anonymous mech=implicit bind_ssf=0 ssf=0
2025-05-09T19:53:37.587674+00:00 ldap slapd[2939]: conn=1034 op=3 BIND dn="uid=ldapadmin,dc=****,dc=****" method=128
2025-05-09T19:53:37.587703+00:00 ldap slapd[2939]: conn=1034 op=3 BIND dn="uid=ldapadmin,dc=****,dc=****" mech=SIMPLE bind_ssf=0 ssf=0
2025-05-09T19:53:37.587734+00:00 ldap slapd[2939]: conn=1034 op=3 RESULT tag=97 err=0 qtime=0.000006 etime=0.000051 text=
2025-05-09T19:53:37.587869+00:00 ldap slapd[2939]: conn=1034 op=4 BIND anonymous mech=implicit bind_ssf=0 ssf=0
2025-05-09T19:53:37.587927+00:00 ldap slapd[2939]: conn=1034 op=4 BIND dn="uid=ldapadmin,dc=****,dc=****" method=128
2025-05-09T19:53:37.587974+00:00 ldap slapd[2939]: conn=1034 op=4 BIND dn="uid=ldapadmin,dc=****,dc=****" mech=SIMPLE bind_ssf=0 ssf=0
2025-05-09T19:53:37.588040+00:00 ldap slapd[2939]: conn=1034 op=4 RESULT tag=97 err=0 qtime=0.000006 etime=0.000049 text=
2025-05-09T19:53:37.791279+00:00 ldap slapd[2939]: conn=1034 op=5 UNBIND
2025-05-09T19:53:37.791400+00:00 ldap slapd[2939]: conn=1034 fd=14 closed

LDAP Server details (please complete the following information):

  • OS: Ubuntu 24.04.2 and 20.04.6
  • Server Name: OpenLDAP
  • Version: 2.6.7 and 2.4.49

Additional context No idea why it does not allow login.

xkill avatar May 09 '25 19:05 xkill

Does uid=ldapadmin,dc=****,dc=**** have an LDAP_LOGIN_OBJECTCLASS as defined in Configuration Variables?

leenooks avatar May 09 '25 22:05 leenooks

I've got the same problem connecting openldap with PLA 2.1.3. however I can use Apache Directory Studio login openldap.

Image

Image

PSilverQ avatar May 12 '25 10:05 PSilverQ

@PSilverQ The answer to my question is relevant for your situation as well, additionally, you might like to refer to the FAQ

leenooks avatar May 12 '25 10:05 leenooks

I use 2.1.1 and same I change use old version osixia/phpldapadmin:0.9.0-amd64(docker) work well

I'm a bit confused about LDAP_LOGIN_OBJECTCLASS, because previously we always used cn=admin to log in, and other services also used cn=admin to bind to the database.

ted423 avatar May 13 '25 09:05 ted423

LDAP_LOGIN_ATTR set to dn? I found this

ted423 avatar May 13 '25 10:05 ted423

seems rootdn can't use to rootdn login

ted423 avatar May 13 '25 10:05 ted423

https://github.com/leenooks/phpLDAPadmin/issues/308

ted423 avatar May 13 '25 10:05 ted423

I can confirm, I have the same issue.

aonoffline avatar May 23 '25 08:05 aonoffline