I'm using dartdap to query ldap for certain records.
- Dartap v0.6.2 https://pub.dev/packages/dartdap
- Dart SDK v.2.17.1
I can connect successfully to ldap, but I can't figure out how to pass search criteria. Let's say I want to retrieve records for cn (common name) containing Joe, cn=Joe*. How would I pass cn=Joe* to dartapp?
The following is a snippet from the credentials and connection section.
var filter = Filter.present('objectClass');
var attrs = ['dn', 'cn', 'objectClass']; //define returned attributes, but where do I pass a filter?
Future example() async {
var host = 'hostname';
var bindDN = 'user@domain';
var password = 'password';````
CodePudding user response:
I found a way to filter. In case anyone else has the same issue, the following works:
// original
var filter = Filter.present('objectClass');
// change to
var filter = Filter.substring('cn', 'Joe*');