Bitai.LDAPHelper.LdapAdapters 10.0.0

Suggested Alternatives

Bitai.LDAPHelper

Additional Details

This package will be removed and not maintained.

dotnet add package Bitai.LDAPHelper.LdapAdapters --version 10.0.0
                    
NuGet\Install-Package Bitai.LDAPHelper.LdapAdapters -Version 10.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bitai.LDAPHelper.LdapAdapters" Version="10.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitai.LDAPHelper.LdapAdapters" Version="10.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Bitai.LDAPHelper.LdapAdapters" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitai.LDAPHelper.LdapAdapters --version 10.0.0
                    
#r "nuget: Bitai.LDAPHelper.LdapAdapters, 10.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bitai.LDAPHelper.LdapAdapters@10.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitai.LDAPHelper.LdapAdapters&version=10.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Bitai.LDAPHelper.LdapAdapters&version=10.0.0
                    
Install as a Cake Tool

Bitai.LDAPHelper.LdapAdapters

Bitai.LDAPHelper.LdapAdapters defines the LDAP adapter contracts used by the Bitai LDAP Helper libraries. It is a small abstraction layer that keeps the core helper logic independent from any specific LDAP client implementation, such as Novell.Directory.Ldap.NETStandard.

This package contains interfaces and enums only. It does not open LDAP connections by itself and does not include a concrete LDAP provider.

Purpose

Use this project when you need to:

  • Implement a concrete LDAP provider for Bitai.LDAPHelper.
  • Test LDAP-dependent code without binding directly to a real directory server.
  • Isolate application logic from vendor-specific LDAP client APIs.
  • Standardize LDAP operations such as bind, search, add, modify, delete, and attribute access.

Target Framework

  • .NET 10.0
  • Nullable reference types enabled
  • Implicit global usings enabled

Package Metadata

  • Package ID: Bitai.LDAPHelper.LdapAdapters
  • Version: 10.0.0
  • Repository: https://github.com/bitai-cs/LDAPHelper
  • License: MIT

Main Contracts

Connection and Factory

  • ILdapConnectionFactoryAdapter creates configured LDAP connections from IConnectionInfo and credentials.
  • ILdapConnectionAdapter represents a connected LDAP session and exposes bind, search, add, modify, delete, disconnect, and dispose operations.
  • IConnectionInfo describes LDAP server address, port, SSL usage, and timeout settings.
  • ISearchLimits describes base DN, search scope, result limits, and timeout limits.
  • ILdapSearchQueueAdapter abstracts queued LDAP search responses.
  • ILdapMessageAdapter distinguishes search result entries from search completion messages.

Entries and Attributes

  • ILdapEntryAdapter exposes an LDAP entry distinguished name and its attribute set.
  • ILdapAttributeSetAdapter creates and retrieves LDAP attributes by name.
  • ILdapAttributeAdapter exposes attribute values as string, string array, byte array, or byte array collection.

Modifications

  • ILdapModificationAdapter describes an LDAP attribute modification.
  • LdapModificationType supports add, delete, and replace operations.
  • LdapSearchScope supports base, one-level, and subtree LDAP searches.

Implementing an Adapter

A concrete provider typically implements ILdapConnectionFactoryAdapter and ILdapConnectionAdapter, then maps the Bitai contracts to the provider-specific LDAP client.

using Bitai.LDAPHelper.LdapAdapters;

public sealed class CustomLdapConnectionFactoryAdapter : ILdapConnectionFactoryAdapter
{
    public async Task<ILdapConnectionAdapter> CreateConnectionAsync(
        IConnectionInfo connectionInfo,
        string userAccount,
        string password,
        bool bindRequired = true)
    {
        var connection = new CustomLdapConnectionAdapter();
        connection.ConnectionTimeout = connectionInfo.ConnectionTimeout;
        connection.SecureSocketLayer = connectionInfo.UseSSL;

        await connection.ConnectAsync(connectionInfo.Server, connectionInfo.ServerPort);

        if (bindRequired)
        {
            await connection.BindAsync(userAccount, password);
        }

        return connection;
    }
}

The adapter is then passed into higher-level Bitai.LDAPHelper services such as authentication, search, account management, and group membership validation.

Design Notes

  • The package intentionally contains no dependency on a specific LDAP SDK.
  • Adapter implementations should preserve provider exceptions only when callers can handle them meaningfully; otherwise, translate them into domain-level exceptions used by the consuming library.
  • ILdapConnectionAdapter implements IDisposable; concrete implementations should release network resources and provider-specific handles consistently.
  • ServerCertificateValidationByPass exists for compatibility with provider adapters. Use it only in controlled development or test environments.

Build

From the repository root:

dotnet build src/Bitai.LDAPHelper.LdapAdapters/Bitai.LDAPHelper.LdapAdapters.csproj
  • Bitai.LDAPHelper: Core LDAP helper services that consume these contracts.
  • Bitai.LDAPHelper.Tests.Mocks: In-memory mock implementations for tests and demos.

License

This project is licensed under the MIT License. See LICENSE.md.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0 257 6/7/2026 10.0.0 is deprecated because it is no longer maintained and has critical bugs.