OidcForge.EntityFramework 4.2.0

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

OidcForge.EntityFramework

Adds Entity Framework Core persistence to the OidcForge OpenID Connect / OAuth 2.0 framework (a maintained fork of IdentityServer4 4.x) on .NET 10: the configuration store (clients, resources), the operational store (grants, device codes) and the store for automatically managed signing keys.

dotnet add package OidcForge.EntityFramework

Usage

var migrationsAssembly = typeof(Program).Assembly.GetName().Name;

services.AddIdentityServer(options => options.KeyManagement.Enabled = true)
    .AddConfigurationStore(options =>
    {
        options.ConfigureDbContext = b => b.UseSqlServer(connectionString,
            sql => sql.MigrationsAssembly(migrationsAssembly));
    })
    .AddOperationalStore(options =>
    {
        options.ConfigureDbContext = b => b.UseSqlServer(connectionString,
            sql => sql.MigrationsAssembly(migrationsAssembly));

        options.EnableTokenCleanup = true;       // remove expired grants in the background
    });
  • AddConfigurationStore() registers the client and resource stores; AddConfigurationStoreCache() adds caching on top.
  • AddOperationalStore() registers the grant and device flow stores, the token cleanup host and the signing key store: with KeyManagement.Enabled the keys live in the Keys table of the operational store instead of files. In a server farm share the ASP.NET Core data protection keys between all instances — the keys are protected with them.
  • Use AddConfigurationStore<TContext>() / AddOperationalStore<TContext>() with your own DbContext types when you need to extend the model.

Migrations

The packages do not ship migrations. Create them in your project:

dotnet ef migrations add Grants -c PersistedGrantDbContext -o Migrations/PersistedGrantDb
dotnet ef migrations add Configuration -c ConfigurationDbContext -o Migrations/ConfigurationDb

Upgrading from IdentityServer4 4.x: the operational store has a new Keys table, so add a migration for PersistedGrantDbContext and apply it before the first start. EF Core 9+ throws on Migrate() when the model has pending changes (dotnet ef migrations has-pending-model-changes -c PersistedGrantDbContext tells you). Reference migrations for SQL Server: src/EntityFramework.Storage/migrations/SqlServer; the Quickstart 5 sample shows a complete setup.

Status and license

Not certified, not affiliated with Duende Software or the .NET Foundation, no commercial support. See the release notes and the issue tracker. Report vulnerabilities privately (SECURITY.MD).

Apache 2.0. Copyright (c) Brock Allen & Dominick Baier, Scott Brady; modifications copyright (c) Yaroslav Tatarenko.

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
4.2.0 136 10/2/2026