Idmt.Plugin
0.1.4
See the version list below for details.
dotnet add package Idmt.Plugin --version 0.1.4
NuGet\Install-Package Idmt.Plugin -Version 0.1.4
<PackageReference Include="Idmt.Plugin" Version="0.1.4" />
<PackageVersion Include="Idmt.Plugin" Version="0.1.4" />
<PackageReference Include="Idmt.Plugin" />
paket add Idmt.Plugin --version 0.1.4
#r "nuget: Idmt.Plugin, 0.1.4"
#:package Idmt.Plugin@0.1.4
#addin nuget:?package=Idmt.Plugin&version=0.1.4
#tool nuget:?package=Idmt.Plugin&version=0.1.4
IDMT Plugin
Identity MultiTenant plugin library for ASP.NET Core that provides automatic identity management (authentication and authorization) and multi-tenancy support using Finbuckle.MultiTenant and Microsoft.AspNetCore.Identity.
Features
- Multi-Tenant Support: Built-in multi-tenancy using Finbuckle.MultiTenant.
- Identity Management: ASP.NET Core Identity integration with support for both Bearer Token (JWT) and Cookie authentication.
- Vertical Slice Architecture: Each identity endpoint has its own handler interface and implementation.
- Minimal APIs: Modern endpoint routing with clean, composable APIs.
- Configurable: Extensive configuration options for identity, cookies, and multi-tenancy strategies.
- Database Agnostic: Works with any Entity Framework Core provider.
Quick Start
1. Install the Package
dotnet add package Idmt.Plugin
2. Configure Services
In your Program.cs, add the IDMT services. You generally need to provide your own DbContext that inherits from IdmtDbContext.
using Idmt.Plugin.Extensions;
var builder = WebApplication.CreateBuilder(args);
// Add IDMT services with your custom DbContext
builder.Services.AddIdmt<MyDbContext>(
builder.Configuration,
// Configure your database provider (e.g., SQL Server, PostgreSQL, SQLite)
options => options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))
);
var app = builder.Build();
// Configure the HTTP request pipeline
app.UseIdmt();
// Ensure database is created and seeded (optional helper)
app.EnsureIdmtDatabase();
app.SeedIdmtData();
app.Run();
3. Application Configuration
Add the Idmt section to your appsettings.json. Below is a comprehensive example with default or common values:
{
"Idmt": {
"Application": {
"ClientUrl": "https://myapp.com",
"ResetPasswordFormPath": "/reset-password",
"ConfirmEmailFormPath": "/confirm-email"
},
"Identity": {
"Password": {
"RequireDigit": true,
"RequireLowercase": true,
"RequireUppercase": true,
"RequireNonAlphanumeric": false,
"RequiredLength": 6
},
"User": {
"RequireUniqueEmail": true
},
"SignIn": {
"RequireConfirmedEmail": false
},
"Cookie": {
"Name": ".Idmt.Application",
"HttpOnly": true,
"SameSite": "Lax",
"ExpireTimeSpan": "14.00:00:00",
"SlidingExpiration": true
}
},
"MultiTenant": {
"DefaultTenantId": "system-tenant",
"Strategies": ["header", "route", "claim"],
"StrategyOptions": {
"HeaderName": "__tenant__",
"RouteParameter": "__tenant__",
"ClaimType": "tenant"
}
},
"Database": {
"AutoMigrate": false
}
}
}
API Reference
The plugin exposes several groups of endpoints.
Authentication (/auth)
Public endpoints for user authentication and account recovery.
| Method | Endpoint | Description | Query/Body Parameters |
|---|---|---|---|
POST |
/auth/login |
Authenticate user | Body: email, password<br>Query: useCookies, useSessionCookies |
POST |
/auth/logout |
Logout user | - |
POST |
/auth/refresh |
Refresh JWT token | Body: refreshToken |
POST |
/auth/forgotPassword |
Request password reset | Body: email<br>Query: useApiLinks (true/false) |
POST |
/auth/resetPassword |
Reset password with token | Query: tenantId, email, token<br>Body: newPassword |
GET |
/auth/confirmEmail |
Confirm email address | Query: tenantId, email, token |
POST |
/auth/resendConfirmationEmail |
Resend confirmation | Body: email<br>Query: useApiLinks |
User Management (/auth/manage)
Endpoints for managing user profiles and accounts.
- Authorization: Some endpoints require specific roles (
SysAdmin,TenantAdmin).
| Method | Endpoint | Policy | Description |
|---|---|---|---|
GET |
/auth/manage/info |
Authenticated | Get current user's info |
PUT |
/auth/manage/info |
Authenticated | Update current user's info |
POST |
/auth/manage/users |
RequireSysUser |
Register a new user (Admin only) |
PUT |
/auth/manage/users/{id} |
RequireTenantManager |
Activate/Deactivate user |
DELETE |
/auth/manage/users/{id} |
RequireTenantManager |
Delete a user |
System & Tenant Access (/sys)
System-level endpoints for managing tenant access.
- Authorization:
RequireSysUser(SysAdmin or SysSupport roles).
| Method | Endpoint | Description |
|---|---|---|
GET |
/sys/info |
Get system version and environment info |
GET |
/sys/users/{id}/tenants |
List tenants accessible by a user |
POST |
/sys/users/{id}/tenants/{tenantId} |
Grant user access to a tenant |
DELETE |
/sys/users/{id}/tenants/{tenantId} |
Revoke user access to a tenant |
Authorization Policies
The plugin comes with pre-configured authorization policies based on roles:
RequireAuthenticatedUser: Any authenticated user.RequireSysAdmin: Users withSysAdminrole.RequireSysUser: Users withSysAdminorSysSupportroles.RequireTenantManager: Users withSysAdmin,SysSupport, orTenantAdminroles.
Architecture
Multi-Tenancy
The library supports multiple tenant resolution strategies out of the box:
- Header: Reads tenant ID from a request header (default
__tenant__). - Route: Reads from a route parameter (default
__tenant__). - Claim: Reads from the user's claims (useful for JWTs).
Authentication Strategies
The plugin uses a hybrid approach:
- Cookie: Standard ASP.NET Core Identity cookies (great for browser apps).
- Bearer Token: Custom implementation compatible with ASP.NET Core Identity's bearer tokens (great for SPAs and Mobile apps).
The CookieOrBearer policy automatically selects the scheme based on the Authorization header.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net9.0
- Finbuckle.MultiTenant (>= 9.4.1)
- Finbuckle.MultiTenant.AspNetCore (>= 9.4.1)
- Finbuckle.MultiTenant.EntityFrameworkCore (>= 9.4.1)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 9.0.10)
- Microsoft.AspNetCore.OpenApi (>= 9.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
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.5.6 | 87 | 1/4/2026 |
| 0.5.5 | 89 | 1/3/2026 |
| 0.5.4 | 96 | 1/2/2026 |
| 0.5.3 | 83 | 1/2/2026 |
| 0.5.1 | 86 | 12/31/2025 |
| 0.5.0 | 88 | 12/31/2025 |
| 0.4.2 | 85 | 12/30/2025 |
| 0.4.1 | 89 | 12/27/2025 |
| 0.4.0 | 169 | 12/23/2025 |
| 0.3.0 | 168 | 12/22/2025 |
| 0.2.1 | 127 | 12/20/2025 |
| 0.2.0 | 270 | 12/18/2025 |
| 0.1.4 | 265 | 12/17/2025 |
| 0.1.3 | 265 | 12/17/2025 |
| 0.1.2 | 270 | 12/16/2025 |
| 0.1.1 | 272 | 12/15/2025 |
| 0.1.0 | 149 | 12/14/2025 |