Microsoft.AspNetCore.Authentication.OpenIdConnect 10.0.0

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.

Showing the top 20 packages that depend on Microsoft.AspNetCore.Authentication.OpenIdConnect.

Packages Downloads
IdentityServer4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
61
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.
38
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.
42
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/aspnet/AspNetCore/tree/331b52b370cd4e7fe2919d4d4cda27412e2ab1cc
39
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/aspnet/AspNetCore/tree/440dadc05b2bed38e6a726c2492db90e77d43c62
38
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/aspnet/AspNetCore/tree/d12868dd7c10ff0433c16b06d3b59d03c40d987a
39
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/1d696053fcd6735aaac1902afdb0b92edbf43e71
39
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/3eeb12e106b9e913c3a4dec1a7d16da7b74149eb
38
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/5a007deadbb2636caff4656333cafc818b6b2ef6
37
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/773e8cc3fbdc2c4ffbd57c1f53f21649ef94c35c
37
Microsoft.AspNetCore.Diagnostics.Identity.Service
ASP.NET Core Identity Service Diagnostics Middleware.
42
Microsoft.AspNetCore.Identity.Service.IntegratedWebClient
ASP.NET Core Identity Service in process client.
42
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
38
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
40
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
45
Microsoft.Identity.Web
This package enables ASP.NET Core Web apps and Web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
38
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
40
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
41
Microsoft.Identity.Web.UI
This package enables UI for ASP.NET Core Web apps that use Microsoft.Identity.Web.
42
Volo.Abp.AspNetCore
Package Description
37

Version Downloads Last updated
10.0.0 15 11/12/2025
10.0.0-rc.2.25502.107 8 10/18/2025
10.0.0-rc.1.25451.107 14 09/13/2025
10.0.0-preview.7.25380.108 11 08/14/2025
10.0.0-preview.6.25358.103 13 07/22/2025
10.0.0-preview.5.25277.114 12 06/08/2025
10.0.0-preview.4.25258.110 21 05/17/2025
10.0.0-preview.3.25172.1 21 04/19/2025
10.0.0-preview.2.25164.1 24 03/25/2025
10.0.0-preview.1.25120.3 26 03/10/2025
9.0.11 12 11/12/2025
9.0.10 7 10/19/2025
9.0.9 10 09/14/2025
9.0.8 11 08/11/2025
9.0.7 19 07/10/2025
9.0.6 13 06/15/2025
9.0.5 20 05/18/2025
9.0.4 21 04/16/2025
9.0.3 27 03/13/2025
9.0.2 23 03/10/2025
9.0.1 25 01/23/2025
9.0.0 31 12/06/2024
9.0.0-rc.2.24474.3 26 12/09/2024
9.0.0-rc.1.24452.1 29 12/09/2024
9.0.0-preview.7.24406.2 28 12/10/2024
9.0.0-preview.6.24328.4 27 12/12/2024
9.0.0-preview.5.24306.11 27 12/07/2024
9.0.0-preview.4.24267.6 28 12/08/2024
9.0.0-preview.3.24172.13 34 12/03/2024
9.0.0-preview.2.24128.4 41 05/02/2024
9.0.0-preview.1.24081.5 28 05/10/2024
8.0.22 11 11/12/2025
8.0.21 8 10/19/2025
8.0.20 10 09/14/2025
8.0.19 14 08/09/2025
8.0.18 12 07/10/2025
8.0.17 14 06/15/2025
8.0.16 18 05/18/2025
8.0.15 21 04/16/2025
8.0.14 24 03/13/2025
8.0.13 22 02/23/2025
8.0.12 26 01/26/2025
8.0.11 27 12/08/2024
8.0.10 29 12/09/2024
8.0.8 23 12/02/2024
8.0.7 25 12/16/2024
8.0.6 24 12/12/2024
8.0.5 23 12/10/2024
8.0.4 39 05/10/2024
8.0.3 22 12/16/2024
8.0.2 21 12/16/2024
8.0.1 34 05/10/2024
8.0.0 31 10/31/2024
8.0.0-rc.2.23480.2 26 12/11/2024
8.0.0-rc.1.23421.29 23 12/09/2024
8.0.0-preview.7.23375.9 27 12/11/2024
8.0.0-preview.6.23329.11 28 12/08/2024
8.0.0-preview.5.23302.2 30 12/09/2024
8.0.0-preview.4.23260.4 22 11/19/2024
8.0.0-preview.3.23177.8 22 12/12/2024
8.0.0-preview.2.23153.2 27 12/09/2024
8.0.0-preview.1.23112.2 27 12/04/2024
7.0.20 28 12/11/2024
7.0.19 31 11/21/2024
7.0.18 31 12/10/2024
7.0.17 23 12/03/2024
7.0.16 28 05/10/2024
7.0.15 30 05/10/2024
7.0.14 31 05/03/2024
7.0.13 27 05/10/2024
7.0.12 29 05/10/2024
7.0.11 26 05/02/2024
7.0.10 37 05/10/2024
7.0.9 24 12/12/2024
7.0.8 23 12/13/2024
7.0.7 27 12/05/2024
7.0.5 27 12/06/2024
7.0.4 22 12/13/2024
7.0.3 24 12/16/2024
7.0.2 25 12/02/2024
7.0.1 22 12/11/2024
7.0.0 34 05/10/2024
7.0.0-rc.2.22476.2 29 12/13/2024
7.0.0-rc.1.22427.2 36 05/10/2024
7.0.0-preview.7.22376.6 24 12/03/2024
7.0.0-preview.6.22330.3 28 12/03/2024
7.0.0-preview.5.22303.8 29 12/09/2024
7.0.0-preview.4.22251.1 22 12/10/2024
6.0.36 31 11/14/2024
6.0.35 31 01/05/2025
6.0.33 25 12/02/2024
6.0.32 25 12/02/2024
6.0.31 26 12/13/2024
6.0.30 29 11/04/2024
6.0.29 28 05/10/2024
6.0.28 29 12/06/2024
6.0.27 25 12/15/2024
6.0.26 23 12/16/2024
6.0.25 30 05/10/2024
6.0.24 25 12/10/2024
6.0.23 27 12/02/2024
6.0.22 24 12/13/2024
6.0.21 31 11/14/2024
6.0.20 23 12/12/2024
6.0.19 31 11/14/2024
6.0.18 21 12/11/2024
6.0.16 28 06/05/2023
6.0.15 28 12/01/2024
6.0.14 25 12/16/2024
6.0.13 34 11/25/2024
6.0.12 46 09/13/2023
6.0.11 27 12/09/2024
6.0.10 33 05/04/2024
6.0.9 31 05/06/2024
6.0.8 28 09/19/2022
6.0.7 26 12/12/2024
6.0.6 26 12/12/2024
6.0.5 31 12/06/2024
6.0.0-rc.1.21452.15 28 05/07/2024
6.0.0-preview.7.21378.6 26 12/08/2024
6.0.0-preview.2.21154.6 23 05/10/2024
6.0.0-preview.1.21103.6 28 12/12/2024
5.0.17 22 12/09/2024
5.0.14 43 05/05/2022
5.0.13 28 12/05/2024
5.0.12 36 05/04/2024
5.0.11 30 12/12/2024
5.0.6 25 12/03/2024
5.0.4 32 05/19/2024
5.0.3 27 12/09/2024
5.0.1 31 05/05/2022
5.0.0-rc.2.20475.17 35 05/10/2024
5.0.0-preview.4.20257.10 29 05/10/2024
3.1.32 23 12/02/2024
3.1.31 26 12/12/2024
3.1.30 30 05/19/2024
3.1.29 28 12/15/2024
3.1.28 26 11/14/2024
3.1.27 21 12/23/2024
3.1.26 28 12/09/2024
3.1.25 22 01/05/2025
3.1.23 26 05/02/2024
3.1.19 28 11/22/2024
3.1.18 32 09/12/2023
3.1.14 31 05/10/2024
3.1.13 37 05/10/2024
3.1.8 32 05/10/2024
3.1.4 31 09/06/2023
3.1.0 24 12/02/2024
3.1.0-preview2.19528.8 24 12/17/2024
3.1.0-preview1.19508.20 24 12/19/2024
3.0.0-preview5-19227-01 25 12/11/2024
2.3.0 25 02/02/2025
2.2.0 36 08/17/2023
2.2.0-preview3-35497 33 05/10/2024
2.2.0-preview2-35157 30 12/11/2024
2.1.2 25 12/10/2024
2.0.3 25 12/08/2024
2.0.1 27 12/03/2024
1.1.0 28 12/08/2024
1.1.0-preview1-final 31 12/12/2024
1.0.5 25 12/05/2024
1.0.1 24 12/10/2024
1.0.0 33 05/06/2022