mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
check group name in ldap result (#150)
This commit is contained in:
parent
8f32f9ae11
commit
0c4d21f204
@ -88,10 +88,10 @@ class Plugin(BaseAuthService):
|
||||
base=self.__base,
|
||||
scope=ldap.SCOPE_SUBTREE,
|
||||
filterstr=f"(&(objectClass=user)(userPrincipalName={user})(memberOf={self.__group}))",
|
||||
attrlist=["userPrincipalName", "memberOf"],
|
||||
attrlist=["memberOf"],
|
||||
timeout=self.__timeout,
|
||||
) or []):
|
||||
if dn is not None and isinstance(attrs, dict) and attrs.get("memberOf"):
|
||||
if dn is not None and isinstance(attrs, dict) and self.__group.encode() in attrs.get("memberOf"): # type: ignore
|
||||
return True
|
||||
except ldap.INVALID_CREDENTIALS:
|
||||
pass
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user