Novell LDAP C# - Novell.Directory.Ldap - Has anybody made it work?

后端 未结 7 1479
走了就别回头了
走了就别回头了 2021-02-02 18:11

I\'m trying to use the library released by Novell (Novell.Directory.Ldap). Version 2.1.10.

What I\'ve done so far:

  • I tested the connection with an appl

7条回答
  •  时光说笑
    2021-02-02 18:43

    I work on Forefront Identity Manager integration. So the code I write always comes from a few calling clients. This may not be appropriate if you are trying to package an application for use "anywhere".

    I just wanted to update this thread with a simple solution for Novell servers which have the default TLS/SSL "confidentiality required" option enabled.

    1) Make sure you get the SSL certificates off the Novell server you are binding too and enroll those into the trusted store on the executing client / server. There are normally two 1 for the IP and for the hostname dependent on which you will call (DNS preferable)

    2) Import the following / add references using System.DirectoryServices; using System.DirectoryServices.Protocols;

    3) Here is a snippet. Make sure you choose the AuthenticationTypes.SecureSocketsLayer which is key.

    // serverAddress = Server IP or DNS (Match SSL certificate)
    // ObjectDN = The DN of the user you are binding to
    // userName = Account which will be used to make the bind
    // password = password of the user which will make the bind
    // value = The value you wish to add to the attribute
    
    // Connect to the user in LDAP
    DirectoryEntry entry = new DirectoryEntry("LDAP://" + serverAddress + "/" + ObjectDN + ""
                    , userName
                    , password
                    , AuthenticationTypes.SecureSocketsLayer);
    // Write the Updated attribute
    entry.Properties["attribute"].Value = value;
    // Read back the updated Attribute into a label
    label.Text = entry.Properties["attribute"].Value.ToString();
    

提交回复
热议问题