I'm trying to check whether a given user is member of a group in AD (need to test the same with openldap also). If I do command line ldapsearch with the filter given it is returning the object, which means the membership exists indirectly. I've tried the same by writing client programs also. The problem I'm facing is, when I try with ldap_search_ext() async calls, it is always failing with No such Object or Can't Contact LDAP server error. When I tried with ldap_search_ext_s() it is working fine. I'm just following the instructions given here.
search FILTER
"(&(cn=user1)(memberof:"AD_LDAP_MATCHING_RULE_IN_CHAIN:=CN=bang-ldap0x,CN=Users,DC=example,DC=com))"
But I'm doing aync bind (ldap_bind) and ldap_search_ext(). I'm not quite sure why it is working in sync calls and not in async.
Any pointers or suggestions would be appreciated.