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 protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com
This email sent to [email protected]