Corely.IAM
2.2.2
dotnet add package Corely.IAM --version 2.2.2
NuGet\Install-Package Corely.IAM -Version 2.2.2
<PackageReference Include="Corely.IAM" Version="2.2.2" />
<PackageVersion Include="Corely.IAM" Version="2.2.2" />
<PackageReference Include="Corely.IAM" />
paket add Corely.IAM --version 2.2.2
#r "nuget: Corely.IAM, 2.2.2"
#:package Corely.IAM@2.2.2
#addin nuget:?package=Corely.IAM&version=2.2.2
#tool nuget:?package=Corely.IAM&version=2.2.2
Corely.IAM
Host-agnostic, multi-tenant identity and access management for .NET applications. Drop-in authentication, authorization, RBAC, and permission management — no external service dependencies.
Upgrading from 1.x? See MIGRATION-2.0.md. MariaDB support is removed, MySQL moved to Oracle's provider and its databases must be recreated, and the target framework is
net10.0only. SQL Server is unaffected.
graph LR
subgraph Host App
A[IAMOptions.Create] --> B[AddIAMServices]
end
B --> C[IRegistrationService]
B --> D[IAuthenticationService]
B --> E[IRetrievalService]
B --> F[IModificationService]
B --> G[IMfaService]
C & D & E & F & G --> H[Processors]
H --> I[Repositories]
I --> J[(Database)]
style A fill:#4a9eff,color:#fff
style B fill:#4a9eff,color:#fff
style C fill:#2ecc71,color:#fff
style D fill:#2ecc71,color:#fff
style E fill:#2ecc71,color:#fff
style F fill:#2ecc71,color:#fff
style G fill:#2ecc71,color:#fff
style H fill:#f39c12,color:#fff
style I fill:#e74c3c,color:#fff
style J fill:#9b59b6,color:#fff
Highlights
- Multi-tenant accounts — users belong to multiple accounts with scoped RBAC
- CRUDX permissions — fine-grained Create / Read / Update / Delete / Execute per resource type
- Token-based auth — JWT with custom claims, no HttpContext dependency
- System context — headless processes (Azure Functions, background services) can call APIs without user authentication
- Password recovery — email-based recovery tokens for unauthenticated password reset
- Multi-factor authentication — TOTP (authenticator apps) with recovery codes
- Google Sign-In — link Google accounts as an alternative auth method
- Invitation system — token-based onboarding with expiry and revocation
- Per-entity encryption — account and user-scoped key pairs, stored encrypted
- Pluggable crypto — configure algorithms via the
IAMOptionsbuilder - Two database providers — SQL Server and MySQL via EF Core
Quick Start
1. Create the database schema
The library never applies migrations at runtime. Create the schema with the migration tool, which ships both providers' migrations:
dotnet tool install --global Corely.IAM.DataAccessMigrations.Cli
corely-iam-db db create -p MsSql -c "Server=(localdb)\MSSQLLocalDB;Database=CorelyIam;Trusted_Connection=True;"
See the Migration CLI docs for deployment scripting, environment-variable configuration, and running against MySQL.
2. Register and use the services
// Register services
var options = IAMOptions.Create(configuration, securityConfigProvider, efConfigFactory);
services.AddIAMServices(options);
// Register a user and account
var registrationService = serviceProvider.GetRequiredService<IRegistrationService>();
var userResult = await registrationService.RegisterUserAsync(
new RegisterUserRequest("admin", "admin@example.com", "P@ssw0rd!"));
var accountResult = await registrationService.RegisterAccountAsync(
new RegisterAccountRequest("My Organization"));
Documentation
| Docs | Description |
|---|---|
| Corely.IAM | Core library — setup, services, domains, security, architecture |
| Corely.IAM.Web | Pre-built Blazor UI — auth pages, account management, RBAC visualization |
| DevTools CLI | Crypto operations and IAM service interaction from the command line |
| Migration CLI | Database creation, migrations, and scripting |
Solution Structure
| Project | Purpose |
|---|---|
Corely.IAM |
Core library — business logic, data access, security |
Corely.IAM.Web |
Blazor Server UI — pages, components, auth flow |
Corely.IAM.WebApp |
Host application (reference implementation) |
Corely.IAM.Demos.UsersOnly |
Demo app — users sign up and own their data, no accounts or roles |
Corely.IAM.Demos.SharedAccount |
Demo app — one team account shared by invited users, no roles to manage |
Corely.IAM.UnitTests |
Test suite (xUnit, Moq, AutoFixture, FluentAssertions) |
Corely.IAM.DevTools |
Developer CLI for crypto and IAM operations |
Corely.IAM.DataAccessMigrations.Cli |
Migration CLI — creates and migrates the IAM schema (published as a .NET tool) |
Corely.IAM.DataAccessMigrations.MsSql / .MySql |
EF Core migrations per database provider, bundled into the CLI |
License
See LICENSE for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Corely.Common (>= 2.0.0)
- Corely.DataAccess (>= 3.0.0)
- Corely.Security (>= 3.0.0)
- FluentValidation (>= 12.1.1)
- FluentValidation.DependencyInjectionExtensions (>= 12.1.1)
- Microsoft.EntityFrameworkCore (>= 10.0.11)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.11)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 8.22.0)
- Microsoft.IdentityModel.Tokens (>= 8.22.0)
- Scrutor (>= 7.0.0)
- System.IdentityModel.Tokens.Jwt (>= 8.22.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Corely.IAM:
| Package | Downloads |
|---|---|
|
Corely.IAM.Web
ASP.NET Core integration for Corely IAM. Provides middleware, services, and Razor components for web-based identity and access management. |
GitHub repositories
This package is not used by any popular GitHub repositories.