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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Innovorium.AspNetCore.Identity.Marten" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Innovorium.AspNetCore.Identity.Marten" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Innovorium.AspNetCore.Identity.Marten" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Innovorium.AspNetCore.Identity.Marten --version 0.1.0
                    
#r "nuget: Innovorium.AspNetCore.Identity.Marten, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Innovorium.AspNetCore.Identity.Marten@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Innovorium.AspNetCore.Identity.Marten&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Innovorium.AspNetCore.Identity.Marten&version=0.1.0
                    
Install as a Cake Tool

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 from MartenIdentityRole. 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. Keep IdentityOptions.Stores.ProtectPersonalData disabled 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.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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