Article

palaniappan1's picture
article
Reads:

15474

Score:
4
4
1
 
Comments:

4

Setting up Novell LDAP Libraries for C#

Author Info

5 August 2009 - 12:24pm
Submitted by: palaniappan1

Tags

(View Disclaimer)

This cool solution is useful for the LDAP Application developers who tend to use Novell's LDAP Libraries for C#, which is a C# implementation of the client side LDAP SDK. And this article will let the readers know how to use the Novell.Directory.Ldap..dll (which is the library that has the LDAP APIs defined as part of the SDK) on Windows and Linux.

Prerequisite:

  1. You need to have the library Novell.Directory.Ldap.dll for setting up.
    Download the Novell.Directory.Ldap.dll file from 'Downloads' section of http://developer.novell.com/wiki/index.php/LDAP_Libraries_for_C_sharp, if you don't have it.
  2. You need to have Mono installed on Linux. Or if your OS is windows, you need to have Mono / Microsoft .Net installed.

On Linux:

  1. Copy the library Novell.Directory.Ldap.dll to your customized project workspace.
  2. Set MONO_PATH variable to point the directory containing Novell.Directory.Ldap.dll as follows (and to the directory having Mono.Security.dll, which will be installed as part of Mono, if use secured LDAP operations).
  3. In your project makefile set reference to Novell.Directory.Ldap.dll using /r:/home/proj/csharp/Novell.Directory.Ldap.dll (and /r:<path to the directory/Mono.Security.dll, if use secured LDAP operations)
  4. Start writing your application including your LDAP Namespace as follows:
    Using Novell.Directory.Ldap;

On Windows (using .Net):

  1. Copy the library Novell.Directory.Ldap.dll and the Mono.Security.dll (This library will be used in case your application needs secured operations to be done. And this will be part of Mono. If you do have Mono installed, get the library from http://www.mono-project.com) to your customized project workspace.
  2. Start Visual Studio .NET. Select File -> New -> Project.
  3. In the Project tab, select the appropriate type to create a C# project.
  4. Select an appropriate project template in the template tab.
  5. Enter the project name and click OK.
  6. Select Project -> Add reference -> Browse.
  7. In Browse, select Novell.Directory.Ldap.dll and mono.security.dll from the location you copied in Step 1. And click OK to Add Reference.
  8. Start writing your application including your LDAP Namespace as follows:
    Using Novell.Directory.Ldap;

For the further references on the details of API and usage, you can visit http://developer.novell.com/wiki/index.php/LDAP_Libraries_for_C_sharp


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

jwilleke's picture

Good Job!

Submitted by jwilleke on 6 August 2009 - 2:07am.

Nice article.

My fears are, like all the LDAP Libraries at Novell, there is no support and there has been no updates to the libraries since early 2008. It appears Novell is no longer actively supporting any of the LDAP libraries.

Sad.
-jim

palaniappan1's picture

Nope.. We are coming up with

Submitted by palaniappan1 on 6 August 2009 - 10:59pm.

Nope.. We are coming up with few fixes and we'll be releasing those LDAP libraries soon (may be with in a week or so)

:)

Palaniappan.

bhwhd's picture

New version? Problem with german umlauts.

Submitted by bhwhd on 7 November 2012 - 4:45am.

Hi all.

As I can see here, version 2.1.11 is the latest:
ftp://sdk.provo.novell.com/ndk/ldapcsharp/ldapcsharp/

This seems to be developed in september 2009 ... three years ago.
Is there anybody working on new versions / updates?

My problem is the following:
I had developed a LDAPBrowser (using C# and GTK# and this Novell LDAP lib).
This LDAPBrowser can be used in Windows as well as in Linux (Ubuntu).
But I have discovered: I can not filter for umlauts with my tool in Linux - filtering for other letters works without any problem. In Windows, I can filter also for umlauts.
Wireshark told me, that (using my LDAPBrowser on Linux) the umlauts get as "00 00" to "the wire".
Using my LDAPBrowser on Windows, the umlaut "ö" for example can be seen as "00 F6" on "the wire".

Any help would be nice :)

Thanks!

bhwhd's picture

Solved: Problem with german umlauts.

Submitted by bhwhd on 8 November 2012 - 12:07am.

Hi all.

My fault...

I used the version 2.0 - this even older version had the problems with german umlauts.
The latest version 2.1.11 does not have this problem anymore.

It was a small bug in the file "Novell.Directory.Ldap.Rfc2251\RfcFilter.cs", method "private sbyte[] unescapeString(System.String string_Renamed)":

The wrong line was:
Array.Copy((System.Array) SupportClass.ToByteArray(utf8Bytes), 0, (System.Array)SupportClass.ToByteArray( octets), iOctets, utf8Bytes.Length);

Not it is corrected to:
Array.Copy((System.Array) (utf8Bytes), 0, (System.Array) octets, iOctets, utf8Bytes.Length);

As this code is only used for chars >0x7f, german umlauts for example worked not, but "normal" chars worked.

Thanks!

© 2013 Novell