Linger.Ldap.AspNetCore 0.3.2-alpha

This is a prerelease version of Linger.Ldap.AspNetCore.
dotnet add package Linger.Ldap.AspNetCore --version 0.3.2-alpha
                    
NuGet\Install-Package Linger.Ldap.AspNetCore -Version 0.3.2-alpha
                    
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="Linger.Ldap.AspNetCore" Version="0.3.2-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Linger.Ldap.AspNetCore" Version="0.3.2-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Linger.Ldap.AspNetCore" />
                    
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 Linger.Ldap.AspNetCore --version 0.3.2-alpha
                    
#r "nuget: Linger.Ldap.AspNetCore, 0.3.2-alpha"
                    
#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 Linger.Ldap.AspNetCore@0.3.2-alpha
                    
#: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=Linger.Ldap.AspNetCore&version=0.3.2-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Linger.Ldap.AspNetCore&version=0.3.2-alpha&prerelease
                    
Install as a Cake Tool

Linger.Ldap.AspNetCore

Linger.Ldap.AspNetCore is a C# helper library designed to simplify LDAP operations in ASP.NET Core applications.

Features

  • Easy integration with ASP.NET Core
  • Simplified LDAP operations
  • Configuration options via Microsoft.Extensions.Options.ConfigurationExtensions

Getting Started

Prerequisites

  • .NET 8.0 SDK or later

Installation

From Visual Studio
  1. Open the Solution Explorer.
  2. Right-click on a project within your solution.
  3. Click on Manage NuGet Packages....
  4. Click on the Browse tab and search for "Linger.Ldap.AspNetCore".
  5. Click on the Linger.Ldap.AspNetCore package, select the appropriate version and click Install.
Package Manager Console
PM> Install-Package Linger.Ldap.AspNetCore
.NET CLI Console
> dotnet add package Linger.Ldap.AspNetCore

Usage

  1. Add the necessary configuration in your appsettings.json:

    "LdapConfig": {
        "Url": "ldap://your-ldap-server",
        "Security": false,
        "Domain": "your-domain",
        "Credentials": {
            "BindDn": "your-bind-dn",
            "BindCredentials": "your-bind-password"
        },
        "SearchBase": "DC=example,DC=com",
        "SearchFilter": "(&(objectClass=user)(objectClass=person)(sAMAccountName={0}))",
        "Attributes": [
            "memberOf",
            "displayName",
            "sAMAccountName",
            "userPrincipalName"
        ]
    }
    
  2. Register the LDAP services in your Program.cs:

    using Linger.Ldap.AspNetCore;
    builder.Services.AddLdapService(builder.Configuration);
    
  3. Inject and use the ILdapService in your controllers or services:

    public class HomeController : Controller
    {
        private readonly ILdapService _ldapService;
    
        public HomeController(ILdapService ldapService)
        {
            _ldapService = ldapService;
        }
    
        public IActionResult Index()
        {
            var ldapCredentials = new LdapCredentials { BindDn = userName, BindCredentials = password };
            var users = _ldapService.FindUser(userName,ldapCredentials);
            return View(users);
        }
    }
    

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.

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
0.3.2-alpha 137 3/17/2025
0.3.1-alpha 121 3/16/2025
0.3.0-alpha 193 3/6/2025
0.2.0-alpha 84 2/9/2025
0.1.2-alpha 85 12/17/2024
0.1.1-alpha 75 12/17/2024
0.1.0-alpha 83 12/6/2024
0.0.4-alpha 72 12/6/2024
0.0.3-alpha 77 11/27/2024
0.0.2-alpha 78 10/3/2024