• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Open Directory Query - What am I doing wrong?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Open Directory Query - What am I doing wrong?
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Prev by Date: 10.10 & timing
  • Next by Date: Socket Filtering NKE
  • Previous by thread: 10.10 & timing
  • Next by thread: Re: Open Directory Query - What am I doing wrong?
  • Index(es):
    • Date
    • Thread