fix(ldap): ldap3 exception
A blank password causes exception 'ldap3.core.exceptions.LDAPPasswordIsMandatoryError'. Validate the user input. Issue #13738
This commit is contained in:
parent
36c5b7fa09
commit
5f6f6a77e5
1 changed files with 1 additions and 1 deletions
|
|
@ -224,7 +224,7 @@ class LDAPSettings(Document):
|
|||
groups = self.fetch_ldap_groups(user, conn)
|
||||
|
||||
# only try and connect as the user, once we have their fqdn entry.
|
||||
if conn.rebind(user=user.entry_dn, password=password):
|
||||
if user.entry_dn and password and conn.rebind(user=user.entry_dn, password=password):
|
||||
return self.create_or_update_user(self.convert_ldap_entry_to_dict(user), groups=groups)
|
||||
|
||||
raise ldap3.core.exceptions.LDAPInvalidCredentialsResult # even though nothing foundor failed authentication raise invalid credentials
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue