jupyterhub / ldapauthenticator

LDAP Authenticator Plugin for Jupyter
BSD 3-Clause "New" or "Revised" License
206 stars 178 forks source link

Case sensitivity of usernames for server start #209

Closed NiklasLiebing closed 2 years ago

NiklasLiebing commented 2 years ago

First of all, you build a nice plugin and I'm not sure if my problem belongs to the plugin itself. My configuration includes the following lines:

c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator' c.LDAPAuthenticator.server_address = 'company.com' c.LDAPAuthenticator.bind_dn_template = ['uid={username},cn=users,dc=company,dc=com'] c.LDAPAuthenticator.valid_usernameregex = '[a-zA-Z0-9.][a-zA-Z0-9.-]{0,252}[a-zA-Z0-9.$-]?

My LDAP users start with a capital letter but during the login process all capital letters are transformed to small letters leading to the following error message when spawning a server Error in Authenticator.pre_spawn_start: KeyError "getpwnam(): name not found: 'username' The plugin and LDAP authentication seem to work, because I end up on the Jupyterhub homepage, where I can theoretically start my server. Nevertheless, the username appears there in lower case. Also LDAP users with just small letters in the username can login.

Creating local accounts for the LDAP users didn't solve the problem but leads to the following funny situation. If the LDAP user and the local user differ only in the upper/lower case, the LDAP user with his account data (username and password) ends up in the local account with the lower case letters even if the password of the local user is different.

welcome[bot] commented 2 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

NiklasLiebing commented 2 years ago

I'm sorry. It can be closed as a duplicate #209