Microsoft.AspNetCore.Authentication.OpenIdConnect 10.0.12

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
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
2
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
12
OrchardCore.Application.Cms.Core.Targets
Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Converts the application into a modular OrchardCore CMS application with TheAdmin theme but without any front-end Themes.
1
OrchardCore.Application.Cms.Targets
Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Converts the application into a modular OrchardCore CMS application with following themes. - TheAdmin Theme - SafeMode Theme - TheAgency Theme - TheBlog Theme - TheComingSoon Theme - TheTheme theme
2
OrchardCore.OpenId
Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Provides OpenId Connect client, server and management features.
1

Version Downloads Last updated
11.0.0 1 2026-11-11
11.0.0-rc.3.26522.148 0 2026-10-25
11.0.0-rc.2.26504.105 0 2026-10-13
11.0.0-rc.1.26425.128 0 2026-09-08
11.0.0-preview.7.26381.103 0 2026-08-11
11.0.0-preview.6.26359.118 0 2026-07-14
11.0.0-preview.5.26302.115 0 2026-06-09
11.0.0-preview.4.26230.115 0 2026-05-12
11.0.0-preview.3.26207.106 0 2026-04-14
11.0.0-preview.2.26159.112 0 2026-03-10
11.0.0-preview.1.26104.118 0 2026-02-10
10.0.15 66 2026-11-16
10.0.14 2 2026-11-14
10.0.13 103 2026-10-15
10.0.12 6 2026-09-15
10.0.11 0 2026-08-11
10.0.10 73 2026-08-01
10.0.9 0 2026-06-09
10.0.8 3 2026-05-18
10.0.7 0 2026-04-21
10.0.6 0 2026-04-14
10.0.5 331 2026-03-18
10.0.4 23 2026-03-12
10.0.3 99 2026-02-23
10.0.2 1 2026-02-21
10.0.1 0 2025-12-09
10.0.0 1 2026-07-29
10.0.0-rc.2.25502.107 0 2025-10-14
10.0.0-rc.1.25451.107 0 2025-09-09
10.0.0-preview.7.25380.108 0 2025-08-12
10.0.0-preview.6.25358.103 0 2025-07-15
10.0.0-preview.5.25277.114 0 2025-06-06
10.0.0-preview.4.25258.110 0 2025-05-12
10.0.0-preview.3.25172.1 0 2025-04-10
10.0.0-preview.2.25164.1 0 2025-03-18
10.0.0-preview.1.25120.3 0 2025-02-25
9.0.23 0 2026-11-10
9.0.22 0 2026-10-25
9.0.21 0 2026-10-13
9.0.20 0 2026-09-08
9.0.19 0 2026-08-11
9.0.18 0 2026-07-14
9.0.17 0 2026-06-09
9.0.16 0 2026-05-12
9.0.15 0 2026-04-14
9.0.14 0 2026-03-10
9.0.13 0 2026-02-10
9.0.12 0 2026-01-13
9.0.11 0 2025-11-11
9.0.10 0 2025-10-14
9.0.9 0 2025-09-09
9.0.8 0 2025-08-05
9.0.7 0 2025-07-08
9.0.6 0 2025-06-10
9.0.5 0 2025-05-13
9.0.4 0 2025-04-08
9.0.3 1 2025-04-07
9.0.2 0 2025-02-11
9.0.1 0 2025-01-14
9.0.0 0 2024-11-12
9.0.0-rc.2.24474.3 0 2024-10-08
9.0.0-rc.1.24452.1 0 2024-09-10
9.0.0-preview.7.24406.2 0 2024-08-13
9.0.0-preview.6.24328.4 0 2024-07-09
9.0.0-preview.5.24306.11 0 2024-06-11
9.0.0-preview.4.24267.6 0 2024-05-21
9.0.0-preview.3.24172.13 0 2024-04-11
9.0.0-preview.2.24128.4 0 2024-03-12
9.0.0-preview.1.24081.5 0 2024-02-13
8.0.34 0 2026-11-10
8.0.33 0 2026-10-25
8.0.32 0 2026-10-13
8.0.31 0 2026-09-08
8.0.30 0 2026-08-11
8.0.29 0 2026-07-14
8.0.28 0 2026-06-09
8.0.27 0 2026-05-12
8.0.26 0 2026-04-14
8.0.25 0 2026-03-10
8.0.24 0 2026-02-10
8.0.23 0 2026-01-13
8.0.22 82 2026-02-04
8.0.21 533 2025-12-18
8.0.20 2 402 2025-09-18
8.0.19 0 2025-08-04
8.0.18 0 2025-07-08
8.0.17 0 2025-06-10
8.0.16 39 2025-05-22
8.0.15 2 2025-04-19
8.0.14 0 2025-03-11
8.0.13 0 2025-02-11
8.0.12 765 2025-04-04
8.0.11 0 2024-11-12
8.0.10 1 672 2025-04-04
8.0.8 345 2025-04-15
8.0.7 0 2024-07-09
8.0.6 0 2024-05-28
8.0.5 0 2024-05-14
8.0.4 0 2024-04-09
8.0.3 0 2024-03-12
8.0.2 0 2024-02-13
8.0.1 0 2024-01-09
8.0.0 2 2025-04-09
8.0.0-rc.2.23480.2 0 2023-10-10
8.0.0-rc.1.23421.29 0 2023-09-12
8.0.0-preview.7.23375.9 0 2023-08-08
8.0.0-preview.6.23329.11 0 2023-07-11
8.0.0-preview.5.23302.2 0 2023-06-13
8.0.0-preview.4.23260.4 0 2023-05-16
8.0.0-preview.3.23177.8 0 2023-04-11
8.0.0-preview.2.23153.2 0 2023-03-14
8.0.0-preview.1.23112.2 0 2023-02-21
7.0.20 0 2024-05-28
7.0.19 0 2024-05-14
7.0.18 0 2024-04-09
7.0.17 0 2024-03-12
7.0.16 0 2024-02-13
7.0.15 0 2024-01-09
7.0.14 0 2023-11-14
7.0.13 0 2023-10-24
7.0.12 0 2023-10-10
7.0.11 0 2023-09-12
7.0.10 0 2023-08-08
7.0.9 0 2023-07-11
7.0.8 0 2023-06-22
7.0.7 0 2023-06-13
7.0.5 0 2023-04-11
7.0.4 0 2023-03-14
7.0.3 0 2023-02-14
7.0.2 0 2023-01-10
7.0.1 0 2022-12-13
7.0.0 0 2022-11-07
7.0.0-rc.2.22476.2 0 2022-10-11
7.0.0-rc.1.22427.2 0 2022-09-14
7.0.0-preview.7.22376.6 0 2022-08-09
7.0.0-preview.6.22330.3 0 2022-07-12
7.0.0-preview.5.22303.8 0 2022-06-14
7.0.0-preview.4.22251.1 0 2022-05-10
7.0.0-preview.3.22178.4 0 2022-04-13
7.0.0-preview.2.22153.2 0 2022-03-14
7.0.0-preview.1.22109.13 0 2022-02-17
6.0.36 1 2025-04-07
6.0.35 0 2024-10-08
6.0.33 0 2024-08-13
6.0.32 0 2024-07-09
6.0.31 0 2024-05-28
6.0.30 0 2024-05-14
6.0.29 1 921 2025-02-26
6.0.28 0 2024-03-12
6.0.27 0 2024-02-13
6.0.26 0 2024-01-09
6.0.25 0 2023-11-14
6.0.24 0 2023-10-24
6.0.23 0 2023-10-10
6.0.22 0 2023-09-12
6.0.21 0 2023-08-08
6.0.20 0 2023-07-11
6.0.19 0 2023-06-22
6.0.18 0 2023-06-13
6.0.16 0 2023-04-11
6.0.15 0 2023-03-14
6.0.14 0 2023-02-14
6.0.13 0 2023-01-10
6.0.12 0 2022-12-13
6.0.11 0 2022-11-07
6.0.10 0 2022-10-11
6.0.9 0 2022-09-13
6.0.8 0 2022-08-09
6.0.7 0 2022-07-12
6.0.6 0 2022-06-14
6.0.5 0 2022-05-10
6.0.4 0 2022-04-11
6.0.3 0 2022-03-08
6.0.2 0 2022-02-08
6.0.1 0 2021-12-14
6.0.0 0 2021-11-08
6.0.0-rc.2.21480.10 0 2021-10-12
6.0.0-rc.1.21452.15 0 2021-09-14
6.0.0-preview.7.21378.6 0 2021-08-10
6.0.0-preview.6.21355.2 0 2021-07-14
6.0.0-preview.5.21301.17 0 2021-06-15
6.0.0-preview.4.21253.5 0 2021-05-24
6.0.0-preview.3.21201.13 0 2021-04-08
6.0.0-preview.2.21154.6 0 2021-03-11
6.0.0-preview.1.21103.6 0 2021-02-12
5.0.17 0 2022-05-10
5.0.16 0 2022-04-11
5.0.15 0 2022-03-08
5.0.14 0 2022-02-08
5.0.13 0 2021-12-14
5.0.12 0 2021-11-07
5.0.11 0 2021-10-12
5.0.10 0 2021-09-14
5.0.9 0 2021-08-10
5.0.8 0 2021-07-13
5.0.7 0 2021-06-08
5.0.6 0 2021-05-11
5.0.5 0 2021-04-06
5.0.4 0 2021-03-09
5.0.3 0 2021-02-09
5.0.2 0 2021-01-12
5.0.1 0 2020-12-08
5.0.0 0 2020-11-09
5.0.0-rc.2.20475.17 0 2020-10-13
5.0.0-rc.1.20451.17 0 2020-09-14
5.0.0-preview.8.20414.8 0 2020-08-25
5.0.0-preview.7.20365.19 0 2020-07-21
5.0.0-preview.6.20312.15 0 2020-06-25
5.0.0-preview.5.20279.2 0 2020-06-10
5.0.0-preview.4.20257.10 0 2020-05-18
5.0.0-preview.3.20215.14 0 2020-04-23
5.0.0-preview.2.20167.3 0 2020-04-02
5.0.0-preview.1.20124.5 0 2020-03-16
3.1.32 0 2022-12-13
3.1.31 0 2022-11-08
3.1.30 0 2022-10-11
3.1.29 0 2022-09-13
3.1.28 0 2022-08-09
3.1.27 0 2022-07-12
3.1.26 0 2022-06-14
3.1.25 0 2022-05-10
3.1.24 0 2022-04-11
3.1.23 0 2022-03-08
3.1.22 0 2021-12-14
3.1.21 0 2021-11-07
3.1.20 0 2021-10-11
3.1.19 0 2021-09-14
3.1.18 0 2021-08-10
3.1.17 0 2021-07-13
3.1.16 0 2021-06-08
3.1.15 0 2021-05-11
3.1.14 0 2021-04-06
3.1.13 0 2021-03-09
3.1.12 0 2021-02-09
3.1.11 0 2021-01-12
3.1.10 0 2020-11-09
3.1.9 0 2020-10-13
3.1.8 0 2020-09-08
3.1.7 0 2020-08-11
3.1.6 0 2020-07-14
3.1.5 0 2020-06-09
3.1.4 0 2020-05-12
3.1.3 0 2020-03-24
3.1.2 0 2020-02-18
3.1.1 0 2020-01-14
3.1.0 0 2019-12-03
3.1.0-preview3.19555.2 0 2019-11-13
3.1.0-preview2.19528.8 0 2019-11-01
3.1.0-preview1.19508.20 0 2019-10-15
3.0.3 0 2020-02-18
3.0.2 0 2020-01-14
3.0.0 0 2019-09-23
3.0.0-rc1.19457.4 0 2019-09-16
3.0.0-preview9.19424.4 0 2019-09-04
3.0.0-preview8.19405.7 0 2019-08-13
3.0.0-preview7.19365.7 0 2019-07-23
3.0.0-preview6.19307.2 0 2019-06-12
3.0.0-preview5-19227-01 0 2019-05-06
3.0.0-preview4-19216-03 0 2019-04-18
3.0.0-preview3-19153-02 0 2019-03-06
3.0.0-preview-19075-0444 0 2019-01-29
2.3.14 0 2026-11-10
2.3.13 0 2026-09-08
2.3.12 0 2026-08-11
2.3.11 0 2026-06-09
2.3.10 0 2026-05-12
2.3.9 0 2026-01-07
2.3.8 0 2026-01-06
2.3.0 0 2025-01-14
2.2.0 0 2018-12-03
2.2.0-preview3-35497 0 2018-10-17
2.2.0-preview2-35157 0 2018-09-12
2.2.0-preview1-35029 0 2018-08-22
2.1.2 0 2018-08-21
2.1.1 0 2018-06-18
2.1.0 0 2018-05-29
2.1.0-rc1-final 0 2018-05-06
2.1.0-preview2-final 0 2018-04-10
2.1.0-preview1-final 0 2018-02-26
2.0.4 0 2018-05-07
2.0.3 0 2018-03-13
2.0.1 0 2017-11-14
2.0.0 0 2017-08-11
2.0.0-preview2-final 0 2017-06-27
2.0.0-preview1-final 0 2017-05-10
1.1.3 0 2017-09-20
1.1.2 0 2017-05-09
1.1.1 0 2017-03-06
1.1.0 0 2016-11-16
1.1.0-preview1-final 0 2016-10-24
1.0.5 0 2017-11-14
1.0.4 0 2017-09-20
1.0.3 0 2017-05-09
1.0.2 0 2017-03-06
1.0.1 0 2016-12-12
1.0.0 0 2016-06-27
1.0.0-rc2-final 0 2016-05-16