Open Directory Query - What am I doing wrong?
Open Directory Query - What am I doing wrong?
- Subject: Open Directory Query - What am I doing wrong?
- From: Fabian Jäger <email@hidden>
- Date: Sat, 22 Nov 2014 16:55:38 +0100
Dear networking experts, I am trying to query an LDAP directory through the Open Directory framework. In address book I can easily find people by entering their email address as the LDAP server is configured as an account there. Now I am trying to accomplish the same programmatically. The code is looking like this:
ODSession* session = [ODSession defaultSession]; self.searchNode = [ODNode nodeWithSession:session type:kODNodeTypeContacts error:nil];
NSError* err = nil; ODQuery* query = [ODQuery queryWithNode:self.searchNode forRecordTypes:kODRecordTypePeople attribute:kODAttributeTypeEMailAddress matchType:kODMatchInsensitiveContains queryValues:@"jaeger" returnAttributes:kODAttributeTypeStandardOnly maximumResults:1 error:&err]; if(query && !err) { NSArray* results = [query resultsAllowingPartial:NO error:nil]; }
Unfortunately, the results array is always empty. What could be the reason for this? Isn’t the globally configured LDAP directory automatically accessible through the Open Directory framework? Or do I need a special authentication process?
Best regards, Fabian |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden