sources/ldap: improve error handling for password complexity (#4780)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
6441401d94
commit
26f3275361
|
@ -71,10 +71,13 @@ class LDAPPasswordChanger:
|
|||
except (LDAPAttributeError, KeyError, IndexError):
|
||||
return False
|
||||
raw_pwd_properties = root_attrs.get("attributes", {}).get("pwdProperties", None)
|
||||
if raw_pwd_properties is None:
|
||||
if not raw_pwd_properties:
|
||||
return False
|
||||
|
||||
try:
|
||||
pwd_properties = PwdProperties(raw_pwd_properties)
|
||||
except ValueError:
|
||||
return False
|
||||
if PwdProperties.DOMAIN_PASSWORD_COMPLEX in pwd_properties:
|
||||
return True
|
||||
|
||||
|
|
Reference in New Issue