Identity.Module.API 2.5.55

There is a newer version of this package available.
See the version list below for details.
dotnet add package Identity.Module.API --version 2.5.55
                    
NuGet\Install-Package Identity.Module.API -Version 2.5.55
                    
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="Identity.Module.API" Version="2.5.55" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Identity.Module.API" Version="2.5.55" />
                    
Directory.Packages.props
<PackageReference Include="Identity.Module.API" />
                    
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 Identity.Module.API --version 2.5.55
                    
#r "nuget: Identity.Module.API, 2.5.55"
                    
#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 Identity.Module.API@2.5.55
                    
#: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=Identity.Module.API&version=2.5.55
                    
Install as a Cake Addin
#tool nuget:?package=Identity.Module.API&version=2.5.55
                    
Install as a Cake Tool

.NET Modular Dynamic Identity Manager

A set of libraries to easily integrate and extend authentication in ASP.NET Core projects, using ASP.NET Core Identity.

🏷️ Description

MinimalApi.Identity is a dynamic and modular identity manager for managing users, roles, claims and more for access control in Asp.Net Mvc Core and Web API, using .NET 8 Minimal API, Entity Framework Core and relational database (of your choice).

This library is still under development of new implementations and in the process of creating the related documentation.

🧩 Features

  • Minimal API: Built using .NET 8 Minimal API for a lightweight and efficient implementation.
  • Entity Framework Core: Uses EF Core for data access, making it easy to integrate with your existing database.
  • Modular: The library is designed to be modular, allowing you to add or remove features as needed.
  • Dynamic: Supports dynamic management of users, roles, claims, forms, licensing and policies.
  • Flexible Configuration: Easily configurable via appsettings.json to suit your application's needs.
  • Outbox Pattern: Implement the transactional outbox pattern for reliable email sending.

πŸ› οΈ Installation

Prerequisites

Setup

The library is available on NuGet, just search for Identity.Module.API in the Package Manager GUI or run the following command in the .NET CLI:

dotnet add package Identity.Module.API

βš™οΈ Configuration

The configuration can be completely managed by adding this section to the appsettings.json file:

The library is still under development, so the configuration may change in future updates.

For migrations you can use a specific project to add to your solution, then configuring the assembly in ConnectionStrings:MigrationsAssembly, otherwise leave it blank and the assembly containing the Program.cs class will be used.

"Kestrel": {
    "Limits": {
        "MaxRequestBodySize": 5242880
    }
},
"ConnectionStrings": {
    "DatabaseType": "sqlserver", // Options: "sqlserver"
    "SQLServer": "Data Source=[HOSTNAME];Initial Catalog=IdentityManager;User ID=[USERNAME];Password=[PASSWORD];Encrypt=False",
    "MigrationsAssembly": "MinimalApi.Identity.Migrations.SQLServer"
},
"JwtOptions": {
    "SchemaName": "Bearer",
    "Issuer": "[ISSUER]",
    "Audience": "[AUDIENCE]",
    "SecurityKey": "[SECURITY-KEY]", // Must be 512 characters long
    "ClockSkew": "00:05:00", // Default: 5 minutes
    "AccessTokenExpirationMinutes": 60, // 60 minutes
    "RefreshTokenExpirationMinutes": 60, // 60 minutes
    "RequireUniqueEmail": true,
    "RequireDigit": true,
    "RequiredLength": 8,
    "RequireUppercase": true,
    "RequireLowercase": true,
    "RequireNonAlphanumeric": true,
    "RequiredUniqueChars": 4,
    "RequireConfirmedEmail": true,
    "MaxFailedAccessAttempts": 3,
    "AllowedForNewUsers": true,
    "DefaultLockoutTimeSpan": "00:05:00" // 5 minutes
},
"SmtpOptions": {
    "Host": "smtp.example.org",
    "Port": 25,
    "Security": "StartTls",
    "Username": "Username del server SMTP",
    "Password": "Password del server SMTP",
    "Sender": "MyApplication <noreply@example.org>",
    "MaxRetryAttempts": 10
},
"ApplicationOptions": {
    
    "ErrorResponseFormat": "List"
},
"FeatureFlagsOptions": {
    "EnabledFeatureLicense": true,
    "EnabledFeatureModule": true
},
"HostedServiceOptions": {
    "IntervalAuthPolicyUpdaterMinutes": 5,
    "IntervalEmailSenderMinutes": 1
},
"UsersOptions": {
    "AssignAdminEmail": "admin@example.org",
    "AssignAdminPassword": "StrongPassword",
    "PasswordExpirationDays": 90
},
"ValidationOptions": {
    "MinLength": 3,
    "MaxLength": 50,
    "MinLengthDescription": 5,
    "MaxLengthDescription": 100
}

πŸ—ƒοΈ Database

Configuration

The library uses Entity Framework Core to manage the database.

The connection string is configured in the ConnectionStrings section of the appsettings.json file.

  • Database Type: Set via ConnectionStrings:DatabaseType (supported values: sqlserver)

After setting the type of database you want to use, modify the corresponding connection string.

Migrations

To update the database schema you need to create migrations, they will be applied automatically at the next application startup.

To create database migrations select MinimalApi.Identity.Core as the default project from the drop-down menu in the Package Manager Console and run the command: Add-Migration MIGRATION-NAME

if you use a separate project for migrations (It is recommended to add a reference in the project name to the database used, in this case it is SQL Server), make sure to set the -Project parameter to the name of that project.

Example: Add-Migration InitialMigration -Project MinimalApi.Identity.Migrations.SQLServer

πŸ”° Feature Flags

🚧 coming soon

πŸ’‘ Usage Examples

The library is still under development, so the Program.cs configuration may change in future updates.

An example configuration of the Program.cs class is available here

πŸ” Authentication

This library currently supports the following authentication types:

  • JWT Bearer Token

πŸ§‘β€πŸ’Ό Administrator Account

🚧 coming soon

πŸ“š API Reference

See the documentation for a list of all available endpoints.

πŸ“¦ Packages

Name Type Version
Identity.Module.API Main Nuget Package
Identity.Module.AccountManager Dependence Coming soon
Identity.Module.ClaimsManager Dependence Coming soon
Identity.Module.Core Dependence Nuget Package
Identity.Module.EmailManager Dependence Nuget Package
Identity.Module.Licenses Dependence Nuget Package
Identity.Module.ModuleManager Dependence Coming soon
Identity.Module.PolicyManager Dependence Nuget Package
Identity.Module.ProfileManager Dependence Coming soon
Identity.Module.RolesManager Dependence Coming soon
Identity.Module.Results Dependence Coming soon

πŸ† Badges

SonarCloud

Quality Gate Status Bugs Code Smells Duplicated Lines (%) Lines of Code

Reliability Rating Security Rating Technical Debt Maintainability Rating Vulnerabilities

πŸ—ΊοΈ Roadmap

  • Move the configuration of the claims to a dedicated library
  • Move the configuration of the module to a dedicated library
  • Move the configuration of the profile manager to a dedicated library
  • Move the configuration of the roles to a dedicated library
  • Add CancellationToken to API endpoints (where necessary)
  • Move email sending logic to a dedicated library
  • Modify email sending logic on a hosted service
  • Changing the hosted service type to a background service in Email Manager
  • Changing the hosted service type to a background service in Policy Manager
  • Add automatic creation of a default administrator account
  • Replacing exceptions with implementation of operation results
  • Replacing the hosted service email sender using Coravel jobs
  • Replacing the hosted service authorization policy updater using Coravel jobs
  • Migrate SmtpOptions configuration to database
  • Migrate FeatureFlagsOptions configuration to database
  • Add support for the MySQL database
  • Add support for the PostgreSQL database
  • Add support for the SQLite database
  • Add support for the AzureSQL database
  • Add endpoints for two-factor authentication and management
  • Add endpoints for downloading and deleting personal data
  • Add support for multi tenancy
  • Add authentication support from third-party providers (e.g. GitHub, Azure)

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

⭐ Give a Star

Don't forget that if you find this project useful, put a ⭐ on GitHub to show your support and help others discover it.

🀝 Contributing

The project is constantly evolving. Contributions are always welcome. Feel free to report issues and submit pull requests to the repository, following the steps below:

  1. Fork the repository
  2. Create a feature branch (starting from the develop branch)
  3. Make your changes
  4. Submit a pull requests (targeting develop)

πŸ†˜ Support

If you have any questions or need help, read here to find out what to do.

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 was computed.  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
2.5.58 0 8/27/2025
2.5.55 10 8/26/2025
2.5.54 36 8/25/2025
2.5.42 90 8/21/2025
2.5.13 144 8/12/2025
2.5.9 127 8/10/2025
2.0.171 89 8/9/2025
2.0.165 207 8/7/2025
2.0.156 207 8/6/2025
2.0.122 39 8/2/2025
2.0.119 112 7/31/2025
2.0.100 96 7/28/2025
2.0.98 288 7/25/2025
2.0.94 493 7/23/2025
2.0.67 125 7/16/2025
2.0.65 135 7/14/2025
2.0.64 66 7/12/2025
2.0.49 139 7/9/2025
2.0.47 241 7/7/2025
2.0.46 237 7/6/2025
2.0.36 74 7/5/2025
2.0.29 118 7/4/2025