Bug 28780

Summary: Auth_with_ldap only searches tree with anon_bind
Product: Koha Reporter: Jerry Marceau <marceau>
Component: AuthenticationAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dpavlin
Version: 21.05   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Auth_with_ldap patch to add tree searching wtih service account

Description Jerry Marceau 2021-07-29 13:14:38 UTC
Created attachment 123282 [details] [review]
Auth_with_ldap patch to add tree searching wtih service account

If auth_by_bind is set, anonymous_bind is not set, and a 'service' account is provided (<user> and <pass>), Auth_with_ldap.pm will not use the service account to search the tree and determine the principal name.  Instead it requires the principal name to be provided in the XML.  

This is a problem when users are in multiple OUs - there is no way to provide a principal name that works for everyone.  It is a relatively easy fix - just adding an elsif to check if a service account is provided, then search the tree with that.  

We have multiple OUs, so I've modified the code and I've provided a patch as a suggestion.  This may not be the ideal fix and it may cause unintended issues for users who aren't doing auth_by_bind.  Would love to see something like this incorporated into the koha code since I have to re-enable these each time we update.