Microsoft provides a DirectoryService class in .NET that is supposed to handle LDAP communication. While it is possible to write applications targeted at non-Microsoft LDAP servers (eDirectory, OpenLDAP) with this class, it is not available on non-Windows CLRs (i.e. Mono), does not support SSL certificates, and has many features that skew towards AD rather than the LDAP specification.

Novell wrote a C# LDAP library that can be used with all .NET-like systems (all CLR-compliant programming languages including VB etc. and all CLR runtimes - Mono on OS X and Linux, Tamarin's Android and iOS tools etc.). It is at: https://www.novell.com/developer/ndk/ldap_libraries_for_c_sharp.html

This library has shown its worth. Xamarin uses it in some code because it is the only decent .NET LDAP library. See:
https://github.com/xamarin/prebuilt-apps/tree/master/EmployeeDirectory/Dependencies/Novell.Directory.Ldap
http://forums.xamarin.com/discussion/8712/compiling-novell-directory-ldap-with-the-error-code-resources-intact

Novell/NetIQ also demonstrated some nice functionality with these libraries in multiple Cool Solutions documents:
https://www.netiq.com/communities/cool-solutions/cool_tools/interactive-ldap-ssl-binding-using-c/
https://www.netiq.com/communities/cool-solutions/setting-novell-ldap-libraries-c/
https://www.netiq.com/communities/cool-solutions/ldap-ssl-authentication-ldap-libraries-c/
https://www.novell.com/coolsolutions/feature/11204.html

However, development on these libraries has been stagnant for many years despite their cross-platform use -- including their use in mobile and on the Mac. It would be greatly appreciated if development on them could resume. In addition to the uses listed above, they would provide a nice LDAP integration for Microfocus's COBOL.NET offering.

These libraries are included with Mono distributions but not with the Xamarin commercial product because Xamarin finds them unpolished. Based on these comments, my own use, and some other bug reports I would recommend the following as possible next steps for improving and iterating the LDAP libraries:

1. Creation of a test matrix of common, large-scale LDAP operations with a goal to polish behavior and performance in existing functionality.
2. Addition of any missing extended LDAP operations.
3. Large-scale performance testing of current extended operation code -- they seem to fail when making large queries of over 60,000 objects or so on some of these operations.
4. Support for newer C# features such as vast changes in async.
5. Integration of the Mono SSL libraries so that SSL operations are smoother.
6. Abstracted classes to make LDAP operations easier (a la LINQ)
7. Polish with the explicit goals of making these the fastest, most stable, and cross-platform LDAP libraries imaginable.

Comments

  • GroupWise 2014 saw new APIs but in general all of the development libraries are old and out of date. Keeping the APIs current would be greatly appreciated.