Marten-backed ASP.NET Core Identity and OpenIddict storage providers for .NET 10.
The source implements the providers. Before installing a package, check the changelog and GitHub releases to select a published functional version; early package-reservation releases do not contain the provider APIs.
The repository ships two independently usable packages:
Innovorium.AspNetCore.Identity.Martenfor ASP.NET Core Identity stores.Innovorium.OpenIddict.Martenfor OpenIddict stores.
It will not be an identity server, UI, application framework, migration product, or owner of your connection, database lifecycle, schema deployment, credentials, application users, authorization policy, server endpoints, consent experience, signing keys, or issuer selection. See Architecture for the intended boundaries.
The packages are independently installable; install only the provider your host uses.
dotnet add package Innovorium.AspNetCore.Identity.MartenSupported: string-keyed users deriving from MartenIdentityUser, optional roles
deriving from MartenIdentityRole, and the standard user/password/email/phone/
security-stamp/lockout/two-factor stores plus claims, external logins,
authentication tokens, authenticator/recovery codes, passkeys, roles, and role
claims. AddMartenStores() replaces the Identity user/role stores only.
using Innovorium.AspNetCore.Identity.Marten;
builder.Services
.AddIdentityCore<ApplicationUser>()
.AddRoles<ApplicationRole>()
.AddMartenStores();
sealed class ApplicationUser : MartenIdentityUser;
sealed class ApplicationRole : MartenIdentityRole;This package supports single-tenanted Identity documents only. It does not
implement IProtectedUserStore<TUser>: disable ProtectPersonalData or choose
another store. It does not provide application profiles, memberships,
entitlements, or authorization policy.
dotnet add package Innovorium.OpenIddict.MartenSupported: the default Marten application, authorization, scope, and token
entities/stores registered by UseMarten(), including OpenIddict manager
queries, revocation, and pruning.
using Innovorium.OpenIddict.Marten;
builder.Services.AddOpenIddict()
.AddCore(options => options.UseMarten());The package does not configure an OpenIddict server, endpoints, consent, issuer, signing/encryption credentials, validation, client-provisioning policy, custom entity types, named document stores, or multi-tenant storage. Revoke and prune process at most 1,000,000 matching rows per invocation in batches of 1,000. Repeat prune when it returns 1,000,000. Do not blindly repeat an unfiltered revoke call because already-revoked rows can be selected again; partition larger revoke workloads with filters that exclude completed rows.
Register Marten before either provider and keep production schema creation disabled:
using JasperFx;
using Marten;
builder.Services.AddMarten(options =>
{
options.Connection(builder.Configuration.GetConnectionString("Marten")
?? throw new InvalidOperationException("ConnectionStrings:Marten is required."));
options.AutoCreateSchemaObjects = AutoCreate.None;
});Neither package selects a connection, obtains credentials, changes auto-creation, supplies migrations, or applies database objects. From the host application configured with the exact provider registrations, use Marten's official CLI to generate and verify reviewed artifacts:
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-assertReview and deliver the forward script through the host database process, test
the generated drop script and backup restoration in a representative
environment, and run db-assert as a deployment check. The first production
application instance must not make schema changes.
The source-only Identity and OpenIddict samples remain checkout evaluation tools, not NuGet installation guidance.
For compatibility, persisted-contract cautions, and upgrade boundaries, see the consumption guide.
Read the changelog, compatibility policy, and customer experience guide. In particular:
- While the project is below 1.0, public APIs and persisted document shapes may change in a minor release when documented in the changelog.
- Your host application remains responsible for PostgreSQL access, secrets, schema deployment, backups, observability, authentication endpoints, authorization, signing credentials, and recovery procedures.
- Use only APIs documented for the exact published version.
- Start a GitHub Discussion for questions, adoption interest, design feedback, or to compare approaches before opening a feature request.
- Open a bug report only for a reproducible defect in published behavior.
- Open a feature proposal for a bounded problem and its API, persistence, compatibility, and security implications.
- Report vulnerabilities privately; see SECURITY.md. Do not disclose secrets, personal data, or active tokens in a public issue or discussion.
See SUPPORT.md for the support boundary and CONTRIBUTING.md for the contributor workflow.
dotnet tool restore
dotnet cake --target VerifyThe Cake build restores dependencies, checks formatting, builds and tests, inspects package contents, compiles an independent clean consumer for each package against its documented registration API, writes checksums, audits NuGet dependencies, and scans repository content and history for secrets when gitleaks is available. PostgreSQL integration tests also require INNOVORIUM_TEST_POSTGRES; CI supplies a disposable database and treats those tests as a release gate.
Licensed under the MIT License.