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):
|
except (LDAPAttributeError, KeyError, IndexError):
|
||||||
return False
|
return False
|
||||||
raw_pwd_properties = root_attrs.get("attributes", {}).get("pwdProperties", None)
|
raw_pwd_properties = root_attrs.get("attributes", {}).get("pwdProperties", None)
|
||||||
if raw_pwd_properties is None:
|
if not raw_pwd_properties:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
pwd_properties = PwdProperties(raw_pwd_properties)
|
try:
|
||||||
|
pwd_properties = PwdProperties(raw_pwd_properties)
|
||||||
|
except ValueError:
|
||||||
|
return False
|
||||||
if PwdProperties.DOMAIN_PASSWORD_COMPLEX in pwd_properties:
|
if PwdProperties.DOMAIN_PASSWORD_COMPLEX in pwd_properties:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Reference in New Issue