LibreBooking / app

Repository for the last open source version of Booked Scheduler. The "develop" branch contains the most current working code of the project and should be considered beta. The "master" branch is the most current stable release of BookedScheduler. Please read doc/README.md for further details.
GNU General Public License v3.0
384 stars 226 forks source link

LDAP bind with "variable" binddn & bindpw #196

Closed jonsito closed 12 months ago

jonsito commented 1 year ago

Hi All. I'm trying to authenticate against an LDAP server where unauthenticated nor anonymous bind is not allowed, and the only way to retrieve ldap data is by providing user's name and password as follows:

/usr/bin/ldapsearch -H ldaps://ldap.unit.org:636 -b ou=users,dc=unit,dc=org -D uid=user.name@unit.org,ou=users,dc=unit,dc=org -x -v -LLL '(uid=user.name@unit.org)' -w user.passwd

That is: each user must provide their own username and password to get access. We have neither "readonly" nor "admin" access, just ask if username/password dupla is valid and retrieve associated data

AFAIK Librebooking does not support "dynamic" binddn & bindpw. So I'm trying to patch code to insert "on the fly" these parameters. Any hint? Is this "feature" planned in any future version?

Thanks in advance Juan Antonio

effgarces commented 1 year ago

Unfortunately I have almost zero experience with LDAP and I'm unable to provide much help on this. At the moment the plan is to maintain the app, fixing bugs and add simple/easy to implement new features, I don't have anything planned on the LDAP front.

jonsito commented 1 year ago

OK. I have a patch that "works for me" (tm) I use an extra ldap config option "provide.user.as.binddn" that, when true, if binddn/bindpw are null, tries to bind using dn: uid={$username},{$basedn} and provided password as bindpw Here comes my patch. perhaps you could consider including into source.

provide_user_as_binddn.patch.gz

colisee commented 1 year ago

Hi @jonsito ,

Actually, file /var/www/html/plugins/Authentication/Ldap/Ldap.config.php lets you define the binddn and bindpw.

Henceforth, there should be no need for a patch...

colisee commented 12 months ago

@jonsito ,

could you please tell us if you could solve your issue by changing the above file? If yes, could you then close this issue?

Thanks.

jonsito commented 12 months ago

Hi. Eventually I made a similar solution: our LDAP authentication server have some specific issues; but code seems ok to me.

Closing issue. Thanks.