Microsoft.AspNetCore.Authentication.OpenIdConnect 10.0.0-preview.2.25164.1

Prefix Reserved
This is a prerelease version of Microsoft.AspNetCore.Authentication.OpenIdConnect.
dotnet add package Microsoft.AspNetCore.Authentication.OpenIdConnect --version 10.0.0-preview.2.25164.1                
NuGet\Install-Package Microsoft.AspNetCore.Authentication.OpenIdConnect -Version 10.0.0-preview.2.25164.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="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.0-preview.2.25164.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.AspNetCore.Authentication.OpenIdConnect --version 10.0.0-preview.2.25164.1                
#r "nuget: Microsoft.AspNetCore.Authentication.OpenIdConnect, 10.0.0-preview.2.25164.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.
// Install Microsoft.AspNetCore.Authentication.OpenIdConnect as a Cake Addin
#addin nuget:?package=Microsoft.AspNetCore.Authentication.OpenIdConnect&version=10.0.0-preview.2.25164.1&prerelease

// Install Microsoft.AspNetCore.Authentication.OpenIdConnect as a Cake Tool
#tool nuget:?package=Microsoft.AspNetCore.Authentication.OpenIdConnect&version=10.0.0-preview.2.25164.1&prerelease                

About

Microsoft.AspNetCore.Authentication.OpenIdConnect provides middleware that enables an application to support the OpenID Connect authentication workflow.

Key Features

  • Single sign-on and single sign-out support
  • Integration with external identity providers
  • Token validation and management
  • Configuration and mapping of user claims

How to Use

To use Microsoft.AspNetCore.Authentication.OpenIdConnect, follow these steps:

Installation

dotnet add package Microsoft.AspNetCore.Authentication.OpenIdConnect

Configuration

To configure Microsoft.AspNetCore.Authentication.OpenIdConnect, you need to add the necessary services and middleware to your application.

  1. In the Program.cs of your ASP.NET Core app, add the following code to register the OpenID Connect authentication services:

    builder.Services
        .AddAuthentication(options =>
        {
            options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
            options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
        })
        .AddCookie()
        .AddOpenIdConnect(options =>
        {
            // Configure the authentication options
            options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
            options.Authority = "your-identity-provider";
            options.ClientId = "your-client-id";
            options.ClientSecret = "your-client-secret-from-user-secrets-or-keyvault";
            options.ResponseType = "code";
            options.Scope.Add("profile");
            options.SaveTokens = true;
        });
    

    Make sure to replace your-identity-provider, your-client-id, and your-client-secret-from-user-secrets-or-keyvault, with the appropriate values for your application and identity provider.

  2. Add the following code to enable the OpenID Connect authentication middleware:

    var app = builder.Build();
    
    app.UseAuthentication();
    

    This ensures that the authentication middleware is added to the request pipeline.

Main Types

The main types provided by Microsoft.AspNetCore.Authentication.OpenIdConnect are:

  • OpenIdConnectOptions: Represents the options for configuring the OpenID Connect authentication middleware
  • OpenIdConnectEvents: Provides event handlers for various stages of the OpenID Connect authentication workflow

For more information on these types and their usage, refer to the official documentation.

Additional Documentation

For additional documentation on using OpenID Connect authentication in ASP.NET Core, you can refer to the following resources:

Feedback & Contributing

Microsoft.AspNetCore.Authentication.OpenIdConnect is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (491)

Showing the top 5 NuGet packages that depend on Microsoft.AspNetCore.Authentication.OpenIdConnect:

Package Downloads
Microsoft.Identity.Web.TokenAcquisition

Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).

Microsoft.AspNetCore.App

Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.

Microsoft.AspNetCore.All

Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.

Microsoft.AspNetCore.Authentication.AzureAD.UI

ASP.NET Core Azure Active Directory Integration provides components for easily integrating Azure Active Directory authentication within your ASP.NET Core application. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/ab1f1c636afa3a6607f2d67bc387b586596d1d38

Duende.IdentityServer

OpenID Connect and OAuth 2.0 Framework for ASP.NET Core

GitHub repositories (122)

Showing the top 5 popular GitHub repositories that depend on Microsoft.AspNetCore.Authentication.OpenIdConnect:

Repository Stars
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
dotnet/eShop
A reference .NET application implementing an eCommerce site
Kareadita/Kavita
Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
Version Downloads Last updated
10.0.0-preview.2.25164.1 250 3/18/2025
10.0.0-preview.1.25120.3 907 2/25/2025
9.0.3 75,466 3/11/2025
9.0.2 325,897 2/11/2025
9.0.1 442,937 1/14/2025
9.0.0 3,126,326 11/12/2024
9.0.0-rc.2.24474.3 166,941 10/8/2024
9.0.0-rc.1.24452.1 73,523 9/10/2024
9.0.0-preview.7.24406.2 2,218 8/13/2024
9.0.0-preview.6.24328.4 107,990 7/9/2024
9.0.0-preview.5.24306.11 999 6/11/2024
9.0.0-preview.4.24267.6 8,075 5/21/2024
9.0.0-preview.3.24172.13 62,889 4/11/2024
9.0.0-preview.2.24128.4 21,277 3/12/2024
9.0.0-preview.1.24081.5 22,629 2/13/2024
8.0.14 60,391 3/11/2025
8.0.13 272,781 2/11/2025
8.0.12 492,436 1/14/2025
8.0.11 1,750,126 11/12/2024
8.0.10 2,196,484 10/8/2024
8.0.8 2,886,756 8/13/2024
8.0.7 1,701,985 7/9/2024
8.0.6 2,350,105 5/28/2024
8.0.5 857,504 5/14/2024
8.0.4 2,981,398 4/9/2024
8.0.3 3,739,631 3/12/2024
8.0.2 1,594,221 2/13/2024
8.0.1 3,430,164 1/9/2024
8.0.0 28,607,523 11/14/2023
8.0.0-rc.2.23480.2 499,149 10/10/2023
8.0.0-rc.1.23421.29 86,027 9/12/2023
8.0.0-preview.7.23375.9 346,650 8/8/2023
8.0.0-preview.6.23329.11 7,998 7/11/2023
8.0.0-preview.5.23302.2 3,855 6/13/2023
8.0.0-preview.4.23260.4 219,455 5/16/2023
8.0.0-preview.3.23177.8 3,647 4/11/2023
8.0.0-preview.2.23153.2 89,263 3/14/2023
8.0.0-preview.1.23112.2 51,940 2/21/2023
7.0.20 139,250 5/28/2024
7.0.19 24,228 5/14/2024
7.0.18 102,591 4/9/2024
7.0.17 61,225 3/12/2024
7.0.16 155,183 2/13/2024
7.0.15 498,031 1/9/2024
7.0.14 1,255,439 11/14/2023
7.0.13 580,366 10/24/2023
7.0.12 448,767 10/10/2023
7.0.11 682,180 9/12/2023
7.0.10 1,197,185 8/8/2023
7.0.9 785,532 7/11/2023
7.0.8 579,527 6/22/2023
7.0.7 248,375 6/13/2023
7.0.5 2,172,061 4/11/2023
7.0.4 718,100 3/14/2023
7.0.3 735,549 2/14/2023
7.0.2 1,064,936 1/10/2023
7.0.1 9,187,916 12/13/2022
7.0.0 3,806,633 11/7/2022
7.0.0-rc.2.22476.2 19,678 10/11/2022
7.0.0-rc.1.22427.2 71,291 9/14/2022
7.0.0-preview.7.22376.6 4,078 8/9/2022
7.0.0-preview.6.22330.3 266,404 7/12/2022
7.0.0-preview.5.22303.8 2,851 6/14/2022
7.0.0-preview.4.22251.1 2,108 5/10/2022
7.0.0-preview.3.22178.4 1,366 4/13/2022
7.0.0-preview.2.22153.2 7,775 3/14/2022
7.0.0-preview.1.22109.13 1,151 2/17/2022
6.0.36 283,885 11/12/2024
6.0.35 247,343 10/8/2024
6.0.33 381,533 8/13/2024
6.0.32 225,940 7/9/2024
6.0.31 346,918 5/28/2024
6.0.30 120,052 5/14/2024
6.0.29 766,818 4/9/2024
6.0.28 359,780 3/12/2024
6.0.27 465,907 2/13/2024
6.0.26 856,457 1/9/2024
6.0.25 1,130,135 11/14/2023
6.0.24 349,883 10/24/2023
6.0.23 247,662 10/10/2023
6.0.22 470,487 9/12/2023
6.0.21 695,992 8/8/2023
6.0.20 605,403 7/11/2023
6.0.19 513,067 6/22/2023
6.0.18 292,517 6/13/2023
6.0.16 1,910,888 4/11/2023
6.0.15 992,697 3/14/2023
6.0.14 1,029,766 2/14/2023
6.0.13 1,615,606 1/10/2023
6.0.12 9,849,064 12/13/2022
6.0.11 2,485,084 11/7/2022
6.0.10 2,561,996 10/11/2022
6.0.9 2,537,686 9/13/2022
6.0.8 2,663,235 8/9/2022
6.0.7 2,339,918 7/12/2022
6.0.6 1,851,286 6/14/2022
6.0.5 3,084,229 5/10/2022
6.0.4 1,753,682 4/11/2022
6.0.3 2,380,402 3/8/2022
6.0.2 1,616,507 2/8/2022
6.0.1 3,389,544 12/14/2021
6.0.0 21,605,370 11/8/2021
6.0.0-rc.2.21480.10 35,572 10/12/2021
6.0.0-rc.1.21452.15 20,783 9/14/2021
6.0.0-preview.7.21378.6 17,836 8/10/2021
6.0.0-preview.6.21355.2 7,060 7/14/2021
6.0.0-preview.5.21301.17 4,843 6/15/2021
6.0.0-preview.4.21253.5 7,553 5/24/2021
6.0.0-preview.3.21201.13 8,076 4/8/2021
6.0.0-preview.2.21154.6 1,567 3/11/2021 6.0.0-preview.2.21154.6 is deprecated because it is no longer maintained.
6.0.0-preview.1.21103.6 3,432 2/12/2021 6.0.0-preview.1.21103.6 is deprecated because it is no longer maintained.
5.0.17 562,559 5/10/2022 5.0.17 is deprecated because it is no longer maintained.
5.0.16 96,456 4/11/2022 5.0.16 is deprecated because it is no longer maintained.
5.0.15 203,043 3/8/2022 5.0.15 is deprecated because it is no longer maintained.
5.0.14 274,893 2/8/2022 5.0.14 is deprecated because it is no longer maintained.
5.0.13 415,179 12/14/2021 5.0.13 is deprecated because it is no longer maintained.
5.0.12 23,315,564 11/7/2021 5.0.12 is deprecated because it is no longer maintained.
5.0.11 1,062,960 10/12/2021 5.0.11 is deprecated because it is no longer maintained.
5.0.10 1,104,001 9/14/2021 5.0.10 is deprecated because it is no longer maintained.
5.0.9 1,126,160 8/10/2021 5.0.9 is deprecated because it is no longer maintained.
5.0.8 802,721 7/13/2021 5.0.8 is deprecated because it is no longer maintained.
5.0.7 966,908 6/8/2021 5.0.7 is deprecated because it is no longer maintained.
5.0.6 839,485 5/11/2021 5.0.6 is deprecated because it is no longer maintained.
5.0.5 1,135,674 4/6/2021 5.0.5 is deprecated because it is no longer maintained.
5.0.4 980,269 3/9/2021 5.0.4 is deprecated because it is no longer maintained.
5.0.3 772,203 2/9/2021 5.0.3 is deprecated because it is no longer maintained.
5.0.2 978,512 1/12/2021 5.0.2 is deprecated because it is no longer maintained.
5.0.1 1,830,653 12/8/2020 5.0.1 is deprecated because it is no longer maintained.
5.0.0 16,335,852 11/9/2020 5.0.0 is deprecated because it is no longer maintained.
5.0.0-rc.2.20475.17 79,770 10/13/2020 5.0.0-rc.2.20475.17 is deprecated because it is no longer maintained.
5.0.0-rc.1.20451.17 615,578 9/14/2020 5.0.0-rc.1.20451.17 is deprecated because it is no longer maintained.
5.0.0-preview.8.20414.8 3,797,977 8/25/2020 5.0.0-preview.8.20414.8 is deprecated because it is no longer maintained.
5.0.0-preview.7.20365.19 13,107 7/21/2020 5.0.0-preview.7.20365.19 is deprecated because it is no longer maintained.
5.0.0-preview.6.20312.15 17,578 6/25/2020 5.0.0-preview.6.20312.15 is deprecated because it is no longer maintained.
5.0.0-preview.5.20279.2 2,220 6/10/2020 5.0.0-preview.5.20279.2 is deprecated because it is no longer maintained.
5.0.0-preview.4.20257.10 1,500 5/18/2020 5.0.0-preview.4.20257.10 is deprecated because it is no longer maintained.
5.0.0-preview.3.20215.14 1,378 4/23/2020 5.0.0-preview.3.20215.14 is deprecated because it is no longer maintained.
5.0.0-preview.2.20167.3 1,199 4/2/2020 5.0.0-preview.2.20167.3 is deprecated because it is no longer maintained.
5.0.0-preview.1.20124.5 1,696 3/16/2020 5.0.0-preview.1.20124.5 is deprecated because it is no longer maintained.
3.1.32 361,652 12/13/2022
3.1.31 42,554 11/8/2022
3.1.30 53,640 10/11/2022
3.1.29 59,832 9/13/2022
3.1.28 57,627 8/9/2022
3.1.27 64,137 7/12/2022
3.1.26 63,672 6/14/2022
3.1.25 98,996 5/10/2022
3.1.24 80,117 4/11/2022
3.1.23 3,201,551 3/8/2022
3.1.22 724,597 12/14/2021
3.1.21 237,238 11/7/2021
3.1.20 262,902 10/11/2021
3.1.19 244,693 9/14/2021
3.1.18 2,352,846 8/10/2021
3.1.17 387,372 7/13/2021
3.1.16 532,772 6/8/2021
3.1.15 348,746 5/11/2021
3.1.14 557,045 4/6/2021
3.1.13 716,365 3/9/2021
3.1.12 513,772 2/9/2021
3.1.11 582,062 1/12/2021
3.1.10 1,393,993 11/9/2020
3.1.9 2,060,738 10/13/2020
3.1.8 5,557,082 9/8/2020
3.1.7 1,407,924 8/11/2020
3.1.6 1,299,802 7/14/2020
3.1.5 1,878,405 6/9/2020
3.1.4 1,545,046 5/12/2020
3.1.3 2,678,673 3/24/2020
3.1.2 1,948,666 2/18/2020
3.1.1 5,206,681 1/14/2020
3.1.0 37,775,759 12/3/2019
3.1.0-preview3.19555.2 5,750 11/13/2019 3.1.0-preview3.19555.2 is deprecated because it is no longer maintained.
3.1.0-preview2.19528.8 1,144 11/1/2019 3.1.0-preview2.19528.8 is deprecated because it is no longer maintained.
3.1.0-preview1.19508.20 1,511 10/15/2019 3.1.0-preview1.19508.20 is deprecated because it is no longer maintained.
3.0.3 1,134,944 2/18/2020 3.0.3 is deprecated because it is no longer maintained.
3.0.2 55,080 1/14/2020 3.0.2 is deprecated because it is no longer maintained.
3.0.0 4,037,946 9/23/2019 3.0.0 is deprecated because it is no longer maintained.
3.0.0-rc1.19457.4 15,539 9/16/2019 3.0.0-rc1.19457.4 is deprecated because it is no longer maintained.
3.0.0-preview9.19424.4 2,266,955 9/4/2019 3.0.0-preview9.19424.4 is deprecated because it is no longer maintained.
3.0.0-preview8.19405.7 9,247 8/13/2019 3.0.0-preview8.19405.7 is deprecated because it is no longer maintained.
3.0.0-preview7.19365.7 32,099 7/23/2019 3.0.0-preview7.19365.7 is deprecated because it is no longer maintained.
3.0.0-preview6.19307.2 7,053 6/12/2019 3.0.0-preview6.19307.2 is deprecated because it is no longer maintained.
3.0.0-preview5-19227-01 11,507 5/6/2019 3.0.0-preview5-19227-01 is deprecated because it is no longer maintained.
3.0.0-preview4-19216-03 4,518 4/18/2019 3.0.0-preview4-19216-03 is deprecated because it is no longer maintained.
3.0.0-preview3-19153-02 115,279 3/6/2019 3.0.0-preview3-19153-02 is deprecated because it is no longer maintained.
3.0.0-preview-19075-0444 4,460 1/29/2019 3.0.0-preview-19075-0444 is deprecated because it is no longer maintained.
2.3.0 1,465 1/14/2025
2.2.0 15,897,347 12/3/2018 2.2.0 is deprecated because it is no longer maintained.
2.2.0-preview3-35497 68,374 10/17/2018 2.2.0-preview3-35497 is deprecated because it is no longer maintained.
2.2.0-preview2-35157 13,400 9/12/2018 2.2.0-preview2-35157 is deprecated because it is no longer maintained.
2.2.0-preview1-35029 9,121 8/22/2018 2.2.0-preview1-35029 is deprecated because it is no longer maintained.
2.1.2 14,549,804 8/21/2018
2.1.1 11,086,845 6/18/2018
2.1.0 12,416,215 5/29/2018
2.1.0-rc1-final 22,887 5/6/2018 2.1.0-rc1-final is deprecated because it is no longer maintained.
2.1.0-preview2-final 30,241 4/10/2018 2.1.0-preview2-final is deprecated because it is no longer maintained.
2.1.0-preview1-final 30,182 2/26/2018 2.1.0-preview1-final is deprecated because it is no longer maintained.
2.0.4 3,968,096 5/7/2018 2.0.4 is deprecated because it is no longer maintained.
2.0.3 7,886,882 3/13/2018 2.0.3 is deprecated because it is no longer maintained.
2.0.1 6,584,789 11/14/2017 2.0.1 is deprecated because it is no longer maintained.
2.0.0 6,755,604 8/11/2017 2.0.0 is deprecated because it is no longer maintained.
2.0.0-preview2-final 57,055 6/27/2017 2.0.0-preview2-final is deprecated because it is no longer maintained.
2.0.0-preview1-final 25,435 5/10/2017 2.0.0-preview1-final is deprecated because it is no longer maintained.
1.1.3 220,732 9/20/2017 1.1.3 is deprecated because it is no longer maintained.
1.1.2 389,757 5/9/2017 1.1.2 is deprecated because it is no longer maintained.
1.1.1 227,466 3/6/2017 1.1.1 is deprecated because it is no longer maintained.
1.1.0 190,088 11/16/2016 1.1.0 is deprecated because it is no longer maintained.
1.1.0-preview1-final 5,872 10/24/2016 1.1.0-preview1-final is deprecated because it is no longer maintained.
1.0.5 7,687 11/14/2017 1.0.5 is deprecated because it is no longer maintained.
1.0.4 4,891 9/20/2017 1.0.4 is deprecated because it is no longer maintained.
1.0.3 8,525 5/9/2017 1.0.3 is deprecated because it is no longer maintained.
1.0.2 70,801 3/6/2017 1.0.2 is deprecated because it is no longer maintained.
1.0.1 19,136 12/12/2016 1.0.1 is deprecated because it is no longer maintained.
1.0.0 236,619 6/27/2016 1.0.0 is deprecated because it is no longer maintained.
1.0.0-rc2-final 12,283 5/16/2016 1.0.0-rc2-final is deprecated because it is no longer maintained.