NuvTools.Security.Identity 10.1.0

dotnet add package NuvTools.Security.Identity --version 10.1.0
                    
NuGet\Install-Package NuvTools.Security.Identity -Version 10.1.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="NuvTools.Security.Identity" Version="10.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NuvTools.Security.Identity" Version="10.1.0" />
                    
Directory.Packages.props
<PackageReference Include="NuvTools.Security.Identity" />
                    
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 NuvTools.Security.Identity --version 10.1.0
                    
#r "nuget: NuvTools.Security.Identity, 10.1.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 NuvTools.Security.Identity@10.1.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=NuvTools.Security.Identity&version=10.1.0
                    
Install as a Cake Addin
#tool nuget:?package=NuvTools.Security.Identity&version=10.1.0
                    
Install as a Cake Tool

NuvTools.Security.Identity

NuGet License

A modular library suite for ASP.NET Identity integration targeting .NET 8, .NET 9, and .NET 10. Provides identity models, permission-based authorization, user management services, and Entity Framework Core persistence.

Libraries

Library Description NuGet
NuvTools.Security.Identity.Models Base models, form DTOs, and API models with localized validation NuGet
NuvTools.Security.Identity Permission-based authorization with dynamic policy provider NuGet
NuvTools.Security.Identity.AspNetCore User management service with email/password workflows and role administration NuGet
NuvTools.Security.Identity.EntityFrameworkCore Identity DbContext with transaction management and batch operations NuGet

Installation

dotnet add package NuvTools.Security.Identity.Models
dotnet add package NuvTools.Security.Identity
dotnet add package NuvTools.Security.Identity.AspNetCore
dotnet add package NuvTools.Security.Identity.EntityFrameworkCore

NuvTools.Security.Identity.Models

Base models, form DTOs, and API response models for ASP.NET Identity.

Key Components:

  • UserBase<TKey> -- Abstract user entity extending IdentityUser<TKey> with Email, Name, Surname, Status, and password validation (6-40 chars, min 1 uppercase, 1 lowercase, 1 digit)
  • RoleBase<TKey> -- Abstract role entity extending IdentityRole<TKey> with Name and Claims
  • Form models: LoginForm, UserForm, UserWithPasswordForm, ChangePasswordForm, ForgotPasswordForm, ResetPasswordForm, UpdateProfileForm
  • API models: TokenResponse, RefreshTokenRequest
  • UserRoles -- DTO for user-role associations

Usage:

using NuvTools.Security.Identity.Models;

public class ApplicationUser : UserBase<Guid>
{
    // Add custom properties if needed
}

public class RegistrationDto : UserWithPasswordForm
{
    // Inherits Email, Name, Surname, Password, ConfirmPassword
    // with localized validation and password complexity requirements
}

NuvTools.Security.Identity

Permission-based authorization with dynamic policy provider and claim-based permission handler.

Key Components:

  • AuthorizationPermissionPolicyProvider -- Dynamically generates policies for names starting with "Permission."
  • PermissionRequirement -- Authorization requirement carrying a permission string
  • PermissionAuthorizationHandler -- Validates permission claims with issuer "LOCAL AUTHORITY"

Usage:

using NuvTools.Security.Identity.Policy;

// Configure in Program.cs
builder.Services.AddSingleton<IAuthorizationPolicyProvider, AuthorizationPermissionPolicyProvider>();
builder.Services.AddSingleton<IAuthorizationHandler, PermissionAuthorizationHandler>();

// Protect endpoints with permissions
[Authorize(Policy = "Permission.Users.Create")]
public IActionResult CreateUser() { }

NuvTools.Security.Identity.AspNetCore

Server-side user management service and role administration. All methods return IResult / IResult<T> from the ResultWrapper pattern.

Key Components:

  • UserServiceBase<TUser, TRole, TKey> -- Abstract service with user CRUD, email confirmation/change, password management, and role operations
  • RoleManagerExtensions -- Extension methods for adding claims and permission claims to roles

Available Operations:

  • User CRUD: GetAllAsync, GetAsync, GetByEmailAsync, CreateAsync, UpdateAsync, DeleteAsync
  • User with roles: CreateWithRolesAsync, GetRolesAsync, UpdateRolesAsync
  • Email: GenerateEmailConfirmationTokenAsync, GenerateEmailConfirmationUriAsync, ConfirmEmailAsync, RequestChangeEmailUrlAsync, ChangeEmailAsync
  • Password: ChangePasswordAsync, RequestResetPasswordUrlAsync, ResetPasswordAsync
  • Status: ToggleUserStatusAsync

Usage:

using NuvTools.Security.Identity.AspNetCore.Services;
using NuvTools.Security.Identity.AspNetCore.Extensions;

public class UserService : UserServiceBase<ApplicationUser, ApplicationRole, Guid>
{
    public UserService(UserManager<ApplicationUser> userManager)
        : base(userManager) { }
}

// Add permission claims to roles
await roleManager.AddPermissionClaims(adminRole,
    "Permission.Users.Create",
    "Permission.Users.Read",
    "Permission.Users.Update",
    "Permission.Users.Delete"
);

NuvTools.Security.Identity.EntityFrameworkCore

Entity Framework Core persistence layer with transaction management and batch operations.

Key Components:

  • IdentityDbContextBase<TUser, TRole, TIdentityKey> -- Abstract DbContext extending IdentityDbContext, implementing IDbContextCommands and IDbContextWithListCommands
  • Transaction management: BeginTransactionAsync, CommitTransactionAsync, RollbackTransactionAsync
  • Execution strategy: ExecuteWithStrategyAsync
  • CRUD: AddAndSaveAsync, UpdateAndSaveAsync, RemoveAndSaveAsync
  • Batch operations: SyncFromListAsync, AddOrUpdateFromListAsync, AddOrRemoveFromListAsync

Usage:

using NuvTools.Security.Identity.EntityFrameworkCore;

public class ApplicationDbContext : IdentityDbContextBase<ApplicationUser, ApplicationRole, Guid>
{
    public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
        : base(options) { }

    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);
        // Configure your entities
    }
}

Building

This solution uses the .slnx (XML-based solution) format.

dotnet build NuvTools.Security.Identity.slnx
dotnet build NuvTools.Security.Identity.slnx -c Release

Project Structure

nuvtools-security-identity/
├── src/
│   ├── NuvTools.Security.Identity.Models/
│   ├── NuvTools.Security.Identity/
│   ├── NuvTools.Security.Identity.AspNetCore/
│   └── NuvTools.Security.Identity.EntityFrameworkCore/
├── NuvTools.Security.Identity.slnx
└── README.md

License

This project is licensed under the terms specified in the LICENSE file.

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 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.

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.1.0 30 1/28/2026
10.0.0 226 12/6/2025
9.5.0 181 10/26/2025
9.2.1 767 5/24/2025
9.2.0 199 5/23/2025
9.1.0 217 4/10/2025
9.0.0 172 11/13/2024
8.1.0 223 9/15/2024
8.0.4 206 4/8/2024
8.0.3 194 3/5/2024
7.0.1 271 8/27/2023
7.0.0 380 2/27/2023