I am using python library ldap3 to send requests to the servers to query user objects that are not disabled and have a display name or email that contains the user input:
query = "(&(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(|(displayName={0}*)(mail={0}*))".format(value)
I followed what I think the documentation says about forming LDAP filters, but I am getting an incorrect LDAP filter error message:
LDAPInvalidFilterError: malformed filter
I played around with it and this works:
query = "(&(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(displayName={0}*))".format(value)
I haven't been able to construct a filter using |
yet. How should the query be constructed?