Запрос групп и членов группы работает нормально, за исключением случая, когда я пытаюсь использовать расширяемое правило сопоставления «LDAP_MATCHING_RULE_IN_CHAIN» ( 1.2.840.113556.1.4.1941) для запроса членов рекурсивных групп.
При этом каждый раз возникает следующая ошибка:
Код: Выделить всё
ldap3.core.exceptions.LDAPAttributeError: invalid attribute ExtensibleMatch:
matchingRule
Код: Выделить всё
import ldap3
s = ldap3.Server(host="", port=636, use_ssl=True, get_info=ldap3.ALL)
c = ldap3.Connection(s, user='', password='
', client_strategy="SYNC", read_only=True)
c.bind()
base = ''
# Get "MYGROUP" distinguished name
c.search(search_base=base, search_filter="(sAMAccountName=MYGROUP)", attributes=["distinguishedName"])
dj_son = json.loads(c.response_to_json())
distinguished_name = dj_son["entries"][0]["attributes"]["distinguishedName"]
# Works fine
c.search(base, '(&(objectclass=user)(memberOf={}))'.format(distinguished_name), attributes=["sAMAccountName"])
# Raises an error "LDAPAttributeError: invalid attribute ExtensibleMatch: matchingRule"
c.search(base, '(&(objectclass=user)(memberOf:1.2.840.113556.1.4.1941:={}))'.format(distinguished_name), attributes=["sAMAccountName"])
- Мой LDAP поддерживает это расширяемое правило сопоставления
- Правило не деактивировано на моем LDAP
- Я использую последнюю версию ldap3 (2.9)
Подробнее здесь: https://stackoverflow.com/questions/786 ... ldap-group