I have been looking for a tutorial on using LDAP on an iOS device is this possible? I havent seen any articles or tutorials on it. Is there another way I should be going about doing authentication against my Active Directory? Can anyone point me in the right direction?
Asked
Active
Viewed 2.4k times
2 Answers
10
I have a port of OpenLDAP with Cyrus-SASL and OpenSSL in my iOS Ports project: https://github.com/bindle/iOSPorts
If using Xcode 4.3 or later, please verify that the Xcode commandline tools are installed before using the following instructions.
To include LDAP support:
- Clone the project: git clone
git://github.com/bindle/iOSPorts.git
- Add the project file
iOSPorts/ports/database/openldap/openldap.xcodeproj
to your Xcode project. - Navigate to the "Build Phases" tab for your build target.
- In "Target Dependencies", add "ldap (openldap)". This will cause the required source code to be downloaded and compiled when you build your target.
- In "Link Binary With Libraries", add the following libraries:
- libresolv.dylib
- libssl.a
- libcrypto.a
- liblber.a
- libldap.a
- libsasl2.a
- Under the "Build Settings", add "/iOSPorts/include" to the "User Header Search Paths".
The OpenLDAP client libraries should now be available from within your project. I have an example project for iOS in examples/database/openldap/ldapsearch (the example returns the search results using NSLog()).

David M. Syzdek
- 15,360
- 6
- 30
- 40
-
Your LDAP example app is broken for XCode 4.3.2 (Lion) by default. The fix is to go into XCode -> Preferences -> Downloads and Install the command line utilities needed for the makefiles. – rwyland Mar 30 '12 at 16:22
-
@rwyland I've updated the post to include information for Xcode 4.3. – David M. Syzdek Mar 30 '12 at 23:51
-
@MuseerAhamadAnsari Can u help me on this? – McDonal_11 Nov 19 '18 at 13:12
8
I was able to Google up a few answers for you.
Integrating LDAP into an iPhone application
And LDAP is even supported within Apple libraries & code, like the iOS configuration profile.

Michael Dautermann
- 88,797
- 17
- 166
- 215