Identity.Module.API
2.5.55
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
<PackageReference Include="Identity.Module.API" Version="2.5.55" />
<PackageVersion Include="Identity.Module.API" Version="2.5.55" />
<PackageReference Include="Identity.Module.API" />
paket add Identity.Module.API --version 2.5.55
#r "nuget: Identity.Module.API, 2.5.55"
#:package Identity.Module.API@2.5.55
#addin nuget:?package=Identity.Module.API&version=2.5.55
#tool nuget:?package=Identity.Module.API&version=2.5.55
.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
- .NET 8.0 SDK (latest version)
- SQL Server 2022 Express installed (setup for Windows) or in Docker version (example)
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 | |
Identity.Module.AccountManager | Dependence | Coming soon |
Identity.Module.ClaimsManager | Dependence | Coming soon |
Identity.Module.Core | Dependence | |
Identity.Module.EmailManager | Dependence | |
Identity.Module.Licenses | Dependence | |
Identity.Module.ModuleManager | Dependence | Coming soon |
Identity.Module.PolicyManager | Dependence | |
Identity.Module.ProfileManager | Dependence | Coming soon |
Identity.Module.RolesManager | Dependence | Coming soon |
Identity.Module.Results | Dependence | Coming soon |
π Badges
πΊοΈ 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:
- Fork the repository
- Create a feature branch (starting from the develop branch)
- Make your changes
- Submit a pull requests (targeting develop)
π Support
If you have any questions or need help, read here to find out what to do.
Product | Versions 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. |
-
net8.0
- Identity.Module.Core (>= 2.5.44)
- Identity.Module.EmailManager (>= 2.5.9)
- Identity.Module.Licenses (>= 1.0.44)
- Identity.Module.PolicyManager (>= 2.5.18)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.19)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 8.0.19)
- Microsoft.AspNetCore.OpenApi (>= 8.0.19)
- Microsoft.EntityFrameworkCore (>= 9.0.8)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.8)
- Swashbuckle.AspNetCore (>= 9.0.3)
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 |