Identity.Base
0.7.12
dotnet add package Identity.Base --version 0.7.12
NuGet\Install-Package Identity.Base -Version 0.7.12
<PackageReference Include="Identity.Base" Version="0.7.12" />
<PackageVersion Include="Identity.Base" Version="0.7.12" />
<PackageReference Include="Identity.Base" />
paket add Identity.Base --version 0.7.12
#r "nuget: Identity.Base, 0.7.12"
#:package Identity.Base@0.7.12
#addin nuget:?package=Identity.Base&version=0.7.12
#tool nuget:?package=Identity.Base&version=0.7.12
Identity.Base
Identity.Base is a reusable Identity + OpenIddict service library for .NET 9.0. It bundles ASP.NET Core Identity, OpenIddict server configuration, MFA, external providers, and optional email integrations into ergonomic extension methods that can be hosted by any ASP.NET Core application.
Getting Started
var builder = WebApplication.CreateBuilder(args);
var identity = builder.Services.AddIdentityBase(
builder.Configuration,
builder.Environment,
configureDbContext: (sp, options) =>
{
var configuration = sp.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("Primary")
?? throw new InvalidOperationException("ConnectionStrings:Primary is required.");
options.UseNpgsql(connectionString, sql => sql.EnableRetryOnFailure());
// or options.UseSqlServer(connectionString);
});
identity
.UseTablePrefix("Contoso") // optional: overrides default "Identity_" prefix
.AddConfiguredExternalProviders() // Google / Microsoft / Apple based on configuration
.AddExternalAuthProvider("github", auth =>
{
// register custom external providers here
return auth.AddOAuth("GitHub", options => { /* ... */ });
})
.UseMailJetEmailSender(); // optional add-on package
var app = builder.Build();
app.UseApiPipeline(); // Add request logging middleware if desired
app.MapControllers();
app.MapApiEndpoints();
app.Run();
Note: browser-based calls to /auth/* endpoints are protected against CSRF-style cross-origin requests. If your SPA is hosted on a different origin, ensure Cors:AllowedOrigins includes that SPA origin. Session cookies are SameSite=Lax and intended only for the Identity host; SPAs should use access tokens for API calls.
Identity.Base no longer ships EF Core migrations. Hosts are responsible for generating and applying migrations (typically from their web/API project) for whichever database provider they choose. Call dotnet ef migrations add InitialIdentityBase from your host, run the migrations, then start the application. Call UseTablePrefix if you need the tables to be emitted with a prefix other than the default Identity_. Enable Mailjet delivery by referencing Identity.Base.Email.MailJet and calling UseMailJetEmailSender().
See the repository README for the full architecture, configuration schemas, and microservice/React integration guides.
Documentation
License
Identity.Base is released under the MIT License.
| 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
- Azure.Identity (>= 1.17.0)
- Azure.Security.KeyVault.Secrets (>= 4.8.0)
- FluentValidation.DependencyInjectionExtensions (>= 12.0.0)
- Microsoft.AspNetCore.Authentication.Google (>= 9.0.10)
- Microsoft.AspNetCore.Authentication.MicrosoftAccount (>= 9.0.10)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 9.0.10)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 9.0.10)
- Microsoft.AspNetCore.OpenApi (>= 9.0.10)
- Microsoft.EntityFrameworkCore (>= 9.0.10)
- Microsoft.EntityFrameworkCore.InMemory (>= 9.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore (>= 9.0.10)
- OpenIddict.EntityFrameworkCore (>= 7.1.0)
- OpenIddict.Server (>= 7.1.0)
- OpenIddict.Server.AspNetCore (>= 7.1.0)
- OpenIddict.Validation (>= 7.1.0)
- OpenIddict.Validation.AspNetCore (>= 7.1.0)
- OpenIddict.Validation.ServerIntegration (>= 7.1.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Identity.Base:
| Package | Downloads |
|---|---|
|
Identity.Base.Roles
Role-based access control primitives for Identity Base: roles, permissions, default configuration, and effective permission resolution. |
|
|
Identity.Base.Organizations
Organization management layer for Identity Base, providing domain entities, EF Core integration, services, and HTTP APIs for organization membership and roles. |
|
|
Identity.Base.Admin
Administrative endpoints, authorization handlers, and helpers for managing Identity Base users, roles, and audit trails. |
|
|
Identity.Base.Email.MailJet
Optional Mailjet email sender integration for Identity Base hosts. |
|
|
Identity.Base.Email.SendGrid
Optional SendGrid email sender integration for Identity Base hosts. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.12 | 40 | 12/30/2025 |
| 0.7.9 | 289 | 12/17/2025 |
| 0.7.7 | 202 | 12/3/2025 |
| 0.7.6 | 206 | 11/26/2025 |
| 0.7.5 | 342 | 11/14/2025 |
| 0.7.4 | 297 | 11/13/2025 |
| 0.7.3 | 299 | 11/10/2025 |
| 0.7.2 | 206 | 11/9/2025 |
| 0.7.1 | 147 | 11/9/2025 |
| 0.6.3 | 145 | 11/8/2025 |
| 0.6.2 | 153 | 11/8/2025 |
| 0.6.1 | 193 | 11/6/2025 |
| 0.5.10 | 196 | 11/5/2025 |
| 0.5.1 | 202 | 11/2/2025 |
| 0.4.3 | 147 | 11/2/2025 |
| 0.4.2 | 146 | 11/2/2025 |
| 0.3.6 | 131 | 11/1/2025 |
| 0.3.4 | 129 | 11/1/2025 |
| 0.2.7 | 120 | 11/1/2025 |
| 0.2.4 | 180 | 10/29/2025 |
| 0.2.3 | 180 | 10/29/2025 |