MultiTenant Identity

Multi-tenant ASP.NET Core Identity: each tenant gets its own users, roles, and passkeys.

MultiTenant Identity gives each tenant its own users, roles, claims, logins, and passkeys while sharing one Identity database and one codebase.

Derive your Identity DbContext from MultiTenantIdentityDbContext and configure Identity as you normally would. It builds on MultiTenant Entity Framework Core.

dotnet add package Finbuckle.MultiTenant.Identity.EntityFrameworkCore
public class AppIdentityDbContext(DbContextOptions<AppIdentityDbContext> options)
    : MultiTenantIdentityDbContext<string>(options);

builder.Services.AddMultiTenantDbContext<AppIdentityDbContext, string>(options =>
    options.UseSqlServer(connectionString));

builder.Services.AddIdentity<IdentityUser, IdentityRole>()
    .AddEntityFrameworkStores<AppIdentityDbContext>();

Releases

Version Targets Released Release notes
v11.0.0New .NET 11 Nov 24, 2026 Release notes
v10.2.0 .NET 10 Nov 12, 2026 Release notes

All versions on NuGet · All releases on GitHub

Users and roles per tenant

Every Identity entity is multi-tenant by default, and unique indexes include the tenant, so the same user name or email can exist in more than one tenant.

  • Works with custom user and role types.
  • Normalized user names and emails are unique per tenant.
  • Supports string, int, Guid, and other tenant ID types.
Read about Identity configuration
public class AppUser : IdentityUser
{
    public string? DisplayName { get; set; }
}

public class AppIdentityDbContext(DbContextOptions<AppIdentityDbContext> options)
    : MultiTenantIdentityDbContext<AppUser, string>(options);

Share what should be shared

Opt individual Identity entities out of isolation when every tenant should see the same data, such as a common set of roles.

  • Call IsNotMultiTenant for any entity in OnModelCreating.
  • Everything else stays isolated by tenant.
Read about customizing the Identity model
protected override void OnModelCreating(ModelBuilder builder)
{
    base.OnModelCreating(builder);

    // every tenant shares the same roles
    builder.Entity<IdentityRole>().IsNotMultiTenant();
}

Passkeys per tenant

With Identity schema version 3, passkeys are isolated by tenant just like users, with no extra DbContext configuration.

  • Passkey entities become multi-tenant automatically.
  • Passkey unique indexes include the tenant.
Read about passkeys
builder.Services.Configure<IdentityOptions>(options =>
{
    // Identity schema version 3 enables passkeys
    options.Stores.SchemaVersion = new Version(3, 0);
});

The rest of the MultiTenant family

MultiTenant Abstractions

Finbuckle.MultiTenant.Abstractions

The shared contracts: tenant info, strategy, store, and tenant context interfaces, with no implementation dependencies.

Learn more

MultiTenant

Finbuckle.MultiTenant

The foundation: tenant resolution, tenant stores, per-tenant options, and running work as a tenant in any .NET app.

Learn more

MultiTenant for ASP.NET Core

Finbuckle.MultiTenant.AspNetCore

Middleware, request-based strategies, and per-tenant authentication for ASP.NET Core apps.

Learn more

MultiTenant for EF Core

Finbuckle.MultiTenant.EntityFrameworkCore

Per-tenant data isolation for EF Core, in a shared database, a database per tenant, or a mix of both.

Learn more