summaryrefslogtreecommitdiff
path: root/kvmd/plugins/auth/ldap.py
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/plugins/auth/ldap.py')
-rw-r--r--kvmd/plugins/auth/ldap.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/kvmd/plugins/auth/ldap.py b/kvmd/plugins/auth/ldap.py
index 8743b2c9..7f7ed597 100644
--- a/kvmd/plugins/auth/ldap.py
+++ b/kvmd/plugins/auth/ldap.py
@@ -91,7 +91,12 @@ class Plugin(BaseAuthService):
attrlist=["memberOf"],
timeout=self.__timeout,
) or []):
- if dn is not None and isinstance(attrs, dict) and self.__group.encode() in attrs.get("memberOf"): # type: ignore
+ if (
+ dn is not None
+ and isinstance(attrs, dict)
+ and isinstance(attrs["memberOf"], (list, dict))
+ and self.__group.encode() in attrs["memberOf"]
+ ):
return True
except ldap.INVALID_CREDENTIALS:
pass