AuthEndpoints.EntityFrameworkCore 5.0.0-preview.1

This is a prerelease version of AuthEndpoints.EntityFrameworkCore.
dotnet add package AuthEndpoints.EntityFrameworkCore --version 5.0.0-preview.1
                    
NuGet\Install-Package AuthEndpoints.EntityFrameworkCore -Version 5.0.0-preview.1
                    
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="AuthEndpoints.EntityFrameworkCore" Version="5.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AuthEndpoints.EntityFrameworkCore" Version="5.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="AuthEndpoints.EntityFrameworkCore" />
                    
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 AuthEndpoints.EntityFrameworkCore --version 5.0.0-preview.1
                    
#r "nuget: AuthEndpoints.EntityFrameworkCore, 5.0.0-preview.1"
                    
#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 AuthEndpoints.EntityFrameworkCore@5.0.0-preview.1
                    
#: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=AuthEndpoints.EntityFrameworkCore&version=5.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AuthEndpoints.EntityFrameworkCore&version=5.0.0-preview.1&prerelease
                    
Install as a Cake Tool

AuthEndpoints.EntityFrameworkCore

EF Core storage for AuthEndpoints. It registers the ASP.NET Core Identity EF stores and the AuthEndpoints stores for email codes, refresh tokens and active sessions, all in your DbContext.

builder.Services.AddDbContext<AppDbContext>(options => options.UseSqlite("Data Source=app.db"));
builder.Services.AddAuthEndpoints<AppUser>()
    .AddEntityFrameworkStores<AppDbContext>()
    .AddPassword()
    .AddEmailCode();

Map the AuthEndpoints tables you use in OnModelCreating:

protected override void OnModelCreating(ModelBuilder builder)
{
    base.OnModelCreating(builder);
    builder.UseEmailCodes();        // email code
    builder.UseRefreshToken();      // JWT
    builder.UseActiveSessions();    // active sessions, after UseRefreshToken
}

For Native AOT, give the key type to AddAuthEndpoints. AddEntityFrameworkStores then registers UserOnlyStore<AppUser, AppDbContext, Guid> (or UserStore and RoleStore with roles) itself, instead of Identity's AddEntityFrameworkStores, which closes the store types by reflection:

builder.Services.AddAuthEndpoints<AppUser, Guid>()                        // or <AppUser, IdentityRole<Guid>, Guid> with roles
    .AddEntityFrameworkStores<AppDbContext>();

To use other storage, skip this package and register your own IUserStore<TUser>, IEmailCodeStore, IRefreshTokenStore and IActiveSessionStore.

Docs: https://authendpoints.harten.id

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
5.0.0-preview.1 0 12/3/2026