rackslab / Slurm-web

Open source web dashboard for Slurm HPC clusters
https://slurm-web.com
GNU General Public License v3.0
291 stars 86 forks source link

Ldap Issue #305

Closed hpc-tau closed 3 weeks ago

hpc-tau commented 3 weeks ago

def login(self, user: str, password: str) -> AuthenticatedUser: """Verify provided user/password are valid and return the corresponding AuthenticatedUser. Raise LDAPAuthenticationError if restricted groups are set and the user in not member of any of these groups.""" fullname = None groups = None connection = self.connection() if user is None or password is None: raise LDAPAuthenticationError("Invalid authentication request") try:

Try simple authentication with user/password on LDAP directory

       user_dn = f"cn={user},{self.user_base}"
       #user_dn = f"uid={user},{self.user_base}"

in the file: /usr/lib/python3.9/site-packages/rfl/authentication/ldap.py I changed from uid= to cn= and now I am able to login 🙂 on line 214 Maybe add a try/except block?

rezib commented 3 weeks ago

Hello @hpc-tau,

Thank you for reporting! I must say I am surprised, I have never seen LDAP directory where user logins are stored within cn attribute. I am feeling curious here, do you know the implementation of this LDAP server? Is it Active Directory?

rezib commented 3 weeks ago

Hello @hpc-tau,

With the upcoming release v3.1.0, you will be able to setup user_name_attribute=cn in [ldap] section of /etc/slurm-web/gateway.ini.

rezib commented 5 days ago

@hpc-tau, Slurm-web v3.1.0 is now available (https://github.com/rackslab/Slurm-web/discussions/311), can you try it fixes your issue?