Innovorium.AspNetCore.Identity.Marten
0.1.0
dotnet add package Innovorium.AspNetCore.Identity.Marten --version 0.1.0
NuGet\Install-Package Innovorium.AspNetCore.Identity.Marten -Version 0.1.0
<PackageReference Include="Innovorium.AspNetCore.Identity.Marten" Version="0.1.0" />
<PackageVersion Include="Innovorium.AspNetCore.Identity.Marten" Version="0.1.0" />
<PackageReference Include="Innovorium.AspNetCore.Identity.Marten" />
paket add Innovorium.AspNetCore.Identity.Marten --version 0.1.0
#r "nuget: Innovorium.AspNetCore.Identity.Marten, 0.1.0"
#:package Innovorium.AspNetCore.Identity.Marten@0.1.0
#addin nuget:?package=Innovorium.AspNetCore.Identity.Marten&version=0.1.0
#tool nuget:?package=Innovorium.AspNetCore.Identity.Marten&version=0.1.0
Innovorium.AspNetCore.Identity.Marten
Marten-backed stores for ASP.NET Core Identity on .NET 10. The package persists Identity users, credentials, claims, logins, tokens, passkeys, and optional roles in PostgreSQL through the host application's Marten document store.
Install
dotnet add package Innovorium.AspNetCore.Identity.Marten
Review the changelog before upgrading. While the project is below 1.0, public APIs and persisted contracts may change in a minor release.
Configure
Configure Marten's connection before adding the Identity stores. The host owns the connection, credentials, PostgreSQL lifecycle, and schema policy.
using Innovorium.AspNetCore.Identity.Marten;
using JasperFx;
using Marten;
using Microsoft.AspNetCore.Identity;
builder.Services.AddMarten(options =>
{
options.Connection(
builder.Configuration.GetConnectionString("Marten")
?? throw new InvalidOperationException(
"ConnectionStrings:Marten is required."));
options.AutoCreateSchemaObjects = AutoCreate.None;
});
builder.Services
.AddIdentityCore<ApplicationUser>()
.AddRoles<ApplicationRole>()
.AddMartenStores();
public sealed class ApplicationUser : MartenIdentityUser;
public sealed class ApplicationRole : MartenIdentityRole;
For Identity without roles, omit AddRoles<T>() and the role type:
builder.Services
.AddIdentityCore<ApplicationUser>()
.AddMartenStores();
AddMartenStores() replaces the registered Identity user store and, when roles are configured, the role store. It does not add an Identity UI, cookies, authentication schemes, authorization policy, or application profile model.
Supported Identity capabilities
User support includes:
- users and queryable users;
- passwords, email, phone numbers, security stamps, lockout, and two-factor state;
- user claims and external logins;
- authentication tokens, authenticator keys, and recovery codes;
- passkeys;
- optional role membership.
Role-enabled registration adds queryable roles and role claims. Store writes use package-owned lightweight Marten sessions, optimistic concurrency, and standard IdentityResult errors for recognized uniqueness and concurrency failures.
Constraints
- User types must derive from
MartenIdentityUser; role types must derive fromMartenIdentityRole. Both use ASP.NET Core Identity's string keys. - Identity user and role documents must be single-tenanted. Marten conjoined tenancy is rejected.
IProtectedUserStore<TUser>is not implemented. KeepIdentityOptions.Stores.ProtectPersonalDatadisabled or choose a provider that supports protected personal data.- The package owns only the Identity persistence adapter. Your application still owns authentication configuration, authorization, secrets, operations, backups, recovery, and domain data associated with the user ID.
Schema ownership
The package registers its Marten document mappings, indexes, optimistic-concurrency metadata, and relationship constraints. It does not select a database, change AutoCreateSchemaObjects, generate application migrations, or apply schema changes.
For production, keep AutoCreateSchemaObjects = AutoCreate.None. Run Marten's official command-line tooling against the host application with its exact Identity and Marten registrations:
builder.Host.ApplyJasperFxExtensions();
// Build and map the host as usual, then replace app.Run():
return await app.RunJasperFxCommands(args);
dotnet run --project <host-project> -- db-patch schema.sql --drop schema.drop.sql
dotnet run --project <host-project> -- db-assert
Review and deploy the generated forward SQL through your normal database release process. Treat the drop script and backup restoration as separately tested recovery paths; application instances should not require production DDL privileges.
Project links
| 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
- Marten (>= 9.21.0 && < 10.0.0)
- Microsoft.Extensions.Identity.Stores (>= 10.0.10 && < 11.0.0)
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.1.0 | 31 | 7/30/2026 |
| 0.1.0-alpha.2 | 33 | 7/30/2026 |