![]() |
VOOZH | about |
dotnet add package AndreGoepel.Marten.Identity --version 1.1.0
NuGet\Install-Package AndreGoepel.Marten.Identity -Version 1.1.0
<PackageReference Include="AndreGoepel.Marten.Identity" Version="1.1.0" />
<PackageVersion Include="AndreGoepel.Marten.Identity" Version="1.1.0" />Directory.Packages.props
<PackageReference Include="AndreGoepel.Marten.Identity" />Project file
paket add AndreGoepel.Marten.Identity --version 1.1.0
#r "nuget: AndreGoepel.Marten.Identity, 1.1.0"
#:package AndreGoepel.Marten.Identity@1.1.0
#addin nuget:?package=AndreGoepel.Marten.Identity&version=1.1.0Install as a Cake Addin
#tool nuget:?package=AndreGoepel.Marten.Identity&version=1.1.0Install as a Cake Tool
ASP.NET Core Identity stores backed by Marten (PostgreSQL). Provides event-sourced user and role stores, cookie login middleware, and DI extensions ready to drop into any ASP.NET Core application.
Marten.AspNetCore)dotnet add package AndreGoepel.Marten.Identity
builder.Services.AddMartenIdentity();
builder.Services.AddMarten(options =>
{
options.Connection(connectionString);
options.InitializeIdentity(); // registers user, role, and user-role projections
options.AutoCreateSchemaObjects = AutoCreate.All;
})
.IntegrateWithWolverine(); // optional — only needed when using Wolverine
AddMartenIdentity accepts an optional Action<IdentityOptions> to customise password rules, lockout policy, etc.
Call UseMartenIdentityMiddleware() after UseAuthentication() / UseAuthorization():
app.UseAuthentication();
app.UseAuthorization();
app.UseMartenIdentityMiddleware();
This registers two middleware components:
| Middleware | Purpose |
|---|---|
SetupRedirectMiddleware |
Redirects to /Setup until an administrator exists, then blocks /Setup |
CookieLoginMiddleware |
Exchanges a one-time login key for an authentication cookie (used by the setup flow) |
Before the first administrator exists, /Setup is reachable without
authentication — that is unavoidable, since no operator credentials exist yet.
Whoever completes setup first becomes the un-deletable root administrator, so a
freshly deployed instance is exposed until setup is finished. To close the
"race to setup" window:
SetupRedirectMiddleware as the authoritative gate. Once an administrator
holds the Administrator role, the middleware redirects /Setup away
unconditionally, so it cannot be re-run to mint a second root admin. Setup
completion now requires a user that actually holds the role — not merely that
the role and some user both exist./Setup page with an
out-of-band bootstrap secret (e.g. an environment variable the operator must
supply) so an attacker cannot claim the first admin even if they reach the
instance first./Setup redirect uses request headers to detect page navigations; that
heuristic is a UX convenience, not a security boundary. Keep [Authorize]
on every administrative page — never rely on the redirect to protect them.| Namespace | Contents |
|---|---|
AndreGoepel.Marten.Identity.Users |
User, UserId, UserStore, event-sourced UserProjection, passkey support |
AndreGoepel.Marten.Identity.Roles |
Role, RoleId, RoleStore, event-sourced RoleProjection, built-in Roles constants |
AndreGoepel.Marten.Identity.UserRoles |
UserRoleAssignment projection for efficient role queries |
AndreGoepel.Marten.Identity.Http |
SetupRedirectMiddleware, CookieLoginMiddleware |
AndreGoepel.Marten.Identity.Services |
ICurrentUserService / CurrentUserService |
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on AndreGoepel.Marten.Identity:
| Package | Downloads |
|---|---|
|
AndreGoepel.Marten.Identity.Blazor
Blazor Server UI components for AndreGoepel.Marten.Identity — login, registration, 2FA, passkeys, and user/role administration pages built with Radzen. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 65 | 6/26/2026 |
| 1.1.0-preview4 | 41 | 6/26/2026 |
| 1.1.0-preview3 | 42 | 6/26/2026 |
| 1.1.0-preview2 | 41 | 6/26/2026 |
| 1.1.0-preview1 | 47 | 6/26/2026 |
| 1.0.2 | 56 | 6/25/2026 |
| 1.0.1 | 109 | 6/13/2026 |
| 1.0.0 | 194 | 6/13/2026 |