Novell.Directory.Ldap.NETStandard Documentation

repository·master·Indexed 20 days ago

https://github.com/dsbenghe/novell.directory.ldap.netstandard

A .NET Standard 2.0/2.1 implementation of the Novell LDAP client library for performing LDAP operations such as Connect, Bind, Add, and Delete. Compatible with .NET 5+, .NET Core 2.0+, .NET Framework 4.6.1+, UWP, and Xamarin, and supports any LDAP protocol-compliant directory server, including Microsoft Active Directory.

Tokens
400
Snippets
2
Records
2
Agent score
20%

What's inside Novell.Directory.Ldap.NETStandard

  1. Install Novell.Directory.Ldap.NETStandard via NuGet

    master

    The library is available as a NuGet package. It is compatible with .NET Standard 2.0/2.1 and supports the following platforms:

    • .NET 5 and above
    • .NET Core 2.0 and above
    • .NET Framework 4.6.1 and above
    • Universal Windows Platform (UWP)
    • Xamarin

    It is compatible with any LDAP protocol-compliant directory server, including Microsoft Active Directory.

    # Use the NuGet package manager to install the library
    dotnet add package Novell.Directory.Ldap.NETStandard
  2. Connect and Bind to an LDAP server

    master

    To interact with an LDAP server, use the LdapConnection class. You typically follow a pattern of connecting to a hostname on a specific port, then performing a BindAsync operation with user credentials to authenticate (this is commonly used to verify user passwords).

    await using (var cn = new LdapConnection())
    {
    	// connect
    	await cn.ConnectAsync("<<hostname>>", 389);
    
    	// bind with an username and password
    	// this how you can verify the password of an user
    	await cn.BindAsync("<<userdn>>", "<<userpassword>>");
    
    	// call ldap op
    	// await cn.DeleteAsync("<<userdn>>")
    	// await cn.AddAsync(<<ldapEntryInstance>>)
    }