OidcForge.AspNetIdentity 4.2.0

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

OidcForge.AspNetIdentity

ASP.NET Core Identity integration for the OidcForge OpenID Connect / OAuth 2.0 framework (a maintained fork of IdentityServer4 4.x) on .NET 10: users, passwords and roles come from ASP.NET Core Identity; the framework issues the tokens.

dotnet add package OidcForge.AspNetIdentity

Usage

services.AddDbContext<ApplicationDbContext>(options => options.UseSqlite(connectionString));

services.AddIdentity<ApplicationUser, IdentityRole>()
    .AddEntityFrameworkStores<ApplicationDbContext>()
    .AddDefaultTokenProviders();

services.AddIdentityServer(options => options.KeyManagement.Enabled = true)
    .AddInMemoryApiScopes(Config.ApiScopes)
    .AddInMemoryClients(Config.Clients)
    .AddAspNetIdentity<ApplicationUser>();

AddAspNetIdentity<TUser>() registers:

  • an IProfileService (ProfileService<TUser>) that turns the ASP.NET Core Identity user's claims and roles into token claims; the user id, user name and role claim types are mapped to sub, name and role,
  • a resource owner password validator (ResourceOwnerPasswordValidator<TUser>) backed by SignInManager<TUser>; failed attempts count towards lockout,
  • a security-stamp callback that keeps the claims captured at sign-in (idp, auth_time, amr) when ASP.NET Core Identity refreshes the principal,
  • cookie configuration: the ASP.NET Core Identity application cookie becomes the default scheme and, like the external and two-factor cookies, is marked essential; the application and external cookies use SameSite=None (required for the iframe-based authorize and check-session requests); browsers accept SameSite=None cookies only over HTTPS.

Login, logout and consent pages are your application's UI — see the Quickstart 6 sample for a complete one.

Notes

  • IdentityConstants exists both in Microsoft.AspNetCore.Identity and in IdentityServer4; add a using alias (using IdentityConstants = Microsoft.AspNetCore.Identity.IdentityConstants;) when a file needs both.
  • Only clients whose AllowedGrantTypes contain the password grant can use the password validator; prefer the authorization code flow with PKCE.

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; 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 114 10/2/2026