Duende.Labs.IdentityModel 2026.806.21

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

IdentityModel for .NET

Modern OpenID Connect and OAuth 2.0 client library for .NET 10+.

Installation

dotnet add package Duende.Labs.IdentityModel

Note This package is experimental/preview. For production scenarios, consider Duende.IdentityModel.

Features

This package provides request/response models and HttpClient extensions for:

  • Discovery document retrieval
  • JSON Web Keys (JWK/JWKS)
  • Token endpoint requests
  • Token introspection and revocation
  • UserInfo endpoint access
  • Device authorization flow
  • Pushed Authorization Requests (PAR)
  • Dynamic client registration
  • Rich Authorization Requests (RAR)

Quick start

using Duende.Labs.IdentityModel.Discovery;

var client = new HttpClient();
var result = await client.GetDiscoveryDocumentAsync(cancellationToken);

if (result.IsSuccess)
{
    Console.WriteLine(result.Response.TokenEndpoint);
}
else
{
    Console.WriteLine(result.Error.Message);
}

Endpoint addresses

Every request record carries a required Uri Address. It can be absolute, or relative to the HttpClient.BaseAddress, which composes naturally with a named client:

services.AddHttpClient("authority", c => c.BaseAddress = new Uri("https://demo.duendesoftware.com"));

// elsewhere
var request = new ClientCredentialsTokenRequest
{
    Address = new Uri("/connect/token", UriKind.Relative),
    ClientCredential = new ClientCredential("m2m", "secret")
};

A relative address without a BaseAddress fails with ProtocolErrorType.InvalidRequest. The resolved absolute address must be https, or http on loopback; anything else fails with ProtocolErrorType.PolicyViolation.

Behaviour change Revocation, UserInfo, device authorization, pushed authorization, dynamic client registration and backchannel authentication previously performed no transport-security validation. They now share the same rule as the token and introspection endpoints, so plaintext http:// requests to a non-loopback host are rejected.

Dependency injection

Duende.Labs.IdentityModel stays dependency-free. If you want configuration-driven registration and endpoint resolution, add the companion package:

dotnet add package Duende.Labs.IdentityModel.DependencyInjection
services.AddIdentityModelClient(options =>
{
    options.Authority = new Uri("https://demo.duendesoftware.com");
    options.ClientCredential = new ClientCredential("m2m", "secret");
    options.Scope = "api";
});

// ...
var result = await client.RequestClientCredentialsTokenAsync(ct);

Endpoints come from the authority's discovery document, which is fetched once per client name and memoized. See the companion package readme.

Samples

Runnable samples are available in the repository under libs/identity-model/dotnet/samples/, for example:

dotnet run --project samples/Discovery
dotnet run --project samples/DependencyInjection

Learn more

License

IdentityModel is open source under the Apache 2.0 license.

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.
  • net10.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Duende.Labs.IdentityModel:

Package Downloads
Duende.Labs.AccessTokenManagement

Automatic access token management for OAuth client credential flows

Duende.Labs.IdentityModel.OidcClient

RFC8252 compliant and certified OpenID Connect and OAuth 2.0 client library for native applications

Duende.Labs.IdentityModel.DependencyInjection

Dependency injection and IHttpClientFactory integration for Duende.Labs.IdentityModel

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.806.21 103 8/6/2026
2026.804.20 108 8/4/2026
2026.729.19 108 7/29/2026
2026.729.18 97 7/29/2026
2026.729.17 95 7/29/2026
2026.728.16 98 7/28/2026
2026.728.15 102 7/28/2026
2026.727.14 422 7/27/2026
2026.727.13 94 7/27/2026
2026.726.12 135 7/26/2026
2026.725.11 685 7/25/2026
2026.724.10 114 7/24/2026
2026.724.9 97 7/24/2026
2026.724.8 89 7/24/2026
Loading failed