Home > OS >  Dartap Search Criteria
Dartap Search Criteria

Time:06-06

I'm using dartdap to query ldap for certain records.

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*');
  • Related