janeczku / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
13.17k stars 1.41k forks source link

Can't Import Users from Microsoft Active Directory with special characters in CN-Path #3231

Open phillipunzen opened 5 days ago

phillipunzen commented 5 days ago

Describe the bug/problem

I already had a "ticket" on the subject, but apparently the messages that the ticket has been closed are no longer coming through.

I have found that I can import users from the Active Directory without special characters in the CN path. Unfortunately, my users have a comma in the CN path. This is due to the pattern: last name, first name.

Could the code perhaps be adapted so that an import works here via LDAP?

As a test, I created a user that contains a space between the first name and last name, and it worked here. Unfortunately, due to the number of users, I cannot create all users again.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Settings
  2. Feature-Configuration
  3. Set LDAP-Settings
  4. Import LDAP-Users
  5. See Errors

Logfile WARN: {cps.admin:1676} LDAP User: CN=Lastname\, Firstname,OU=LDAP-Benutzer,OU=Benutzer,DC=phillipde,DC=local Not Found

Expected behavior

I want to sync my LDAP-Users from the Microsoft Active Directory

Environment (please complete the following information):

OzzieIsaacs commented 4 days ago

I fixed the usecase that the "," is escaped via a backslash (this was how it looked in my testing infrastructure). I'll check what to do if this isn't the case