Microsoft.AspNetCore.Authentication.OpenIdConnect 10.0.8

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
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
138
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
139
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
140
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
141
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
143
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
144
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
147
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
153
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
160
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
164
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.
138
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.
142

Version Downloads Last updated
11.0.0-preview.4.26230.115 7 05/12/2026
11.0.0-preview.3.26207.106 13 04/14/2026
11.0.0-preview.2.26159.112 22 03/11/2026
11.0.0-preview.1.26104.118 27 02/10/2026
10.0.8 7 05/12/2026
10.0.7 14 04/21/2026
10.0.6 17 04/14/2026
10.0.5 29 03/13/2026
10.0.4 27 03/11/2026
10.0.3 32 02/10/2026
10.0.2 47 01/15/2026
10.0.1 56 12/10/2025
10.0.0 152 11/12/2025
10.0.0-rc.2.25502.107 80 10/15/2025
10.0.0-rc.1.25451.107 76 09/10/2025
10.0.0-preview.7.25380.108 89 08/14/2025
10.0.0-preview.6.25358.103 83 07/17/2025
10.0.0-preview.5.25277.114 74 06/06/2025
10.0.0-preview.4.25258.110 105 05/14/2025
10.0.0-preview.3.25172.1 113 04/12/2025
10.0.0-preview.2.25164.1 111 04/01/2025
10.0.0-preview.1.25120.3 108 03/31/2025
9.0.16 7 05/12/2026
9.0.15 14 04/14/2026
9.0.14 20 03/12/2026
9.0.13 25 02/10/2026
9.0.12 26 01/14/2026
9.0.11 64 11/12/2025
9.0.10 71 10/15/2025
9.0.9 71 09/10/2025
9.0.8 139 08/06/2025
9.0.7 90 07/09/2025
9.0.6 90 06/12/2025
9.0.5 89 05/15/2025
9.0.4 99 04/10/2025
9.0.3 285 03/25/2025
9.0.2 114 02/19/2025
9.0.1 93 03/31/2025
9.0.0 121 11/14/2024
9.0.0-rc.2.24474.3 102 10/20/2024
9.0.0-rc.1.24452.1 103 09/17/2024
9.0.0-preview.7.24406.2 126 08/20/2024
9.0.0-preview.6.24328.4 128 07/21/2024
9.0.0-preview.5.24306.11 160 07/21/2024
9.0.0-preview.4.24267.6 133 07/21/2024
9.0.0-preview.3.24172.13 140 07/21/2024
9.0.0-preview.2.24128.4 130 07/21/2024
9.0.0-preview.1.24081.5 130 07/21/2024
8.0.27 7 05/12/2026
8.0.26 20 04/14/2026
8.0.25 22 03/11/2026
8.0.24 29 02/10/2026
8.0.23 29 01/14/2026
8.0.22 54 11/12/2025
8.0.21 67 10/15/2025
8.0.20 69 09/10/2025
8.0.19 73 08/06/2025
8.0.18 86 07/09/2025
8.0.17 88 06/12/2025
8.0.16 99 05/15/2025
8.0.15 115 04/10/2025
8.0.14 102 03/30/2025
8.0.13 100 03/30/2025
8.0.12 110 03/30/2025
8.0.11 100 11/14/2024
8.0.10 96 10/23/2024
8.0.8 228 08/20/2024
8.0.7 133 07/21/2024
8.0.6 113 07/21/2024
8.0.5 119 07/21/2024
8.0.4 152 07/21/2024
8.0.3 131 06/27/2024
8.0.2 125 07/21/2024
8.0.1 149 02/04/2024
8.0.0 139 02/13/2024
8.0.0-rc.2.23480.2 121 07/21/2024
8.0.0-rc.1.23421.29 115 07/21/2024
8.0.0-preview.7.23375.9 133 07/21/2024
8.0.0-preview.6.23329.11 145 07/21/2024
8.0.0-preview.5.23302.2 137 07/21/2024
8.0.0-preview.4.23260.4 125 07/21/2024
8.0.0-preview.3.23177.8 120 07/21/2024
8.0.0-preview.2.23153.2 116 07/21/2024
8.0.0-preview.1.23112.2 139 07/21/2024
7.0.20 134 07/21/2024
7.0.19 123 07/21/2024
7.0.18 122 07/21/2024
7.0.17 117 07/21/2024
7.0.16 127 07/21/2024
7.0.15 120 07/21/2024
7.0.14 137 07/21/2024
7.0.13 124 07/21/2024
7.0.12 124 07/21/2024
7.0.11 110 07/21/2024
7.0.10 130 07/21/2024
7.0.9 129 07/21/2024
7.0.8 122 07/21/2024
7.0.7 135 07/21/2024
7.0.5 136 07/21/2024
7.0.4 132 07/21/2024
7.0.3 122 07/21/2024
7.0.2 138 07/21/2024
7.0.1 144 07/16/2024
7.0.0 121 02/05/2024
7.0.0-rc.2.22476.2 131 07/21/2024
7.0.0-rc.1.22427.2 130 07/21/2024
7.0.0-preview.7.22376.6 146 07/21/2024
7.0.0-preview.6.22330.3 143 07/21/2024
7.0.0-preview.5.22303.8 129 07/21/2024
7.0.0-preview.4.22251.1 144 07/21/2024
7.0.0-preview.3.22178.4 138 07/21/2024
7.0.0-preview.2.22153.2 122 07/21/2024
7.0.0-preview.1.22109.13 119 07/21/2024
6.0.36 94 11/14/2024
6.0.35 103 10/23/2024
6.0.33 104 08/20/2024
6.0.32 131 07/21/2024
6.0.31 128 07/21/2024
6.0.30 139 07/21/2024
6.0.29 126 07/21/2024
6.0.28 138 07/21/2024
6.0.27 124 07/21/2024
6.0.26 150 07/21/2024
6.0.25 132 07/21/2024
6.0.24 146 07/21/2024
6.0.23 130 07/21/2024
6.0.22 126 07/21/2024
6.0.21 129 07/21/2024
6.0.20 137 07/21/2024
6.0.19 119 07/21/2024
6.0.18 138 07/21/2024
6.0.16 143 07/21/2024
6.0.15 130 07/21/2024
6.0.14 129 07/21/2024
6.0.13 136 07/21/2024
6.0.12 131 07/21/2024
6.0.11 135 07/21/2024
6.0.10 131 07/21/2024
6.0.9 123 07/21/2024
6.0.8 132 07/21/2024
6.0.7 119 07/21/2024
6.0.6 112 07/21/2024
6.0.5 163 07/21/2024
6.0.4 130 07/21/2024
6.0.3 156 02/15/2024
6.0.2 122 07/21/2024
6.0.1 127 07/21/2024
6.0.0 143 04/17/2024
6.0.0-rc.2.21480.10 141 07/21/2024
6.0.0-rc.1.21452.15 128 07/21/2024
6.0.0-preview.7.21378.6 133 07/21/2024
6.0.0-preview.6.21355.2 131 07/21/2024
6.0.0-preview.5.21301.17 128 07/21/2024
6.0.0-preview.4.21253.5 133 07/21/2024
6.0.0-preview.3.21201.13 125 07/21/2024
6.0.0-preview.2.21154.6 122 07/21/2024
6.0.0-preview.1.21103.6 129 07/21/2024
5.0.17 132 07/21/2024
5.0.16 124 07/21/2024
5.0.15 140 07/21/2024
5.0.14 126 07/21/2024
5.0.13 136 07/21/2024
5.0.12 127 07/21/2024
5.0.11 140 07/21/2024
5.0.10 124 07/21/2024
5.0.9 132 07/21/2024
5.0.8 119 07/21/2024
5.0.7 128 07/21/2024
5.0.6 128 07/21/2024
5.0.5 124 07/21/2024
5.0.4 119 07/21/2024
5.0.3 133 07/21/2024
5.0.2 133 07/21/2024
5.0.1 133 07/21/2024
5.0.0 126 07/21/2024
5.0.0-rc.2.20475.17 128 07/21/2024
5.0.0-rc.1.20451.17 133 07/21/2024
5.0.0-preview.8.20414.8 143 07/21/2024
5.0.0-preview.7.20365.19 130 07/21/2024
5.0.0-preview.6.20312.15 131 07/21/2024
5.0.0-preview.5.20279.2 131 07/21/2024
5.0.0-preview.4.20257.10 133 07/21/2024
5.0.0-preview.3.20215.14 132 07/21/2024
5.0.0-preview.2.20167.3 137 07/21/2024
5.0.0-preview.1.20124.5 134 07/21/2024
3.1.32 116 07/21/2024
3.1.31 124 07/21/2024
3.1.30 127 07/21/2024
3.1.29 139 07/21/2024
3.1.28 131 07/21/2024
3.1.27 152 07/21/2024
3.1.26 113 07/21/2024
3.1.25 148 07/21/2024
3.1.24 119 07/21/2024
3.1.23 129 07/21/2024
3.1.22 132 07/21/2024
3.1.21 132 07/21/2024
3.1.20 126 07/21/2024
3.1.19 118 07/21/2024
3.1.18 134 07/21/2024
3.1.17 127 07/21/2024
3.1.16 123 07/21/2024
3.1.15 136 07/21/2024
3.1.14 132 07/21/2024
3.1.13 133 07/21/2024
3.1.12 135 07/21/2024
3.1.11 135 07/21/2024
3.1.10 140 07/21/2024
3.1.9 121 07/21/2024
3.1.8 127 07/21/2024
3.1.7 144 07/21/2024
3.1.6 135 07/21/2024
3.1.5 134 07/21/2024
3.1.4 119 07/21/2024
3.1.3 131 07/21/2024
3.1.2 131 07/21/2024
3.1.1 125 07/20/2024
3.1.0 123 07/21/2024
3.1.0-preview3.19555.2 132 07/21/2024
3.1.0-preview2.19528.8 132 07/21/2024
3.1.0-preview1.19508.20 130 07/21/2024
3.0.3 121 07/21/2024
3.0.2 128 07/21/2024
3.0.0 127 07/21/2024
3.0.0-rc1.19457.4 124 07/21/2024
3.0.0-preview9.19424.4 140 07/21/2024
3.0.0-preview8.19405.7 131 07/21/2024
3.0.0-preview7.19365.7 125 07/21/2024
3.0.0-preview6.19307.2 142 07/21/2024
3.0.0-preview5-19227-01 144 07/21/2024
3.0.0-preview4-19216-03 115 07/21/2024
3.0.0-preview3-19153-02 123 07/21/2024
3.0.0-preview-19075-0444 126 07/21/2024
2.3.10 6 05/13/2026
2.3.9 31 01/08/2026
2.3.8 28 01/07/2026
2.3.0 117 04/05/2025
2.2.0 120 07/21/2024
2.2.0-preview3-35497 123 07/21/2024
2.2.0-preview2-35157 131 07/21/2024
2.2.0-preview1-35029 140 07/21/2024
2.1.2 148 07/21/2024
2.1.1 114 07/21/2024
2.1.0 139 07/21/2024
2.1.0-rc1-final 129 07/21/2024
2.1.0-preview2-final 125 07/21/2024
2.1.0-preview1-final 129 07/21/2024
2.0.4 122 07/21/2024
2.0.3 122 07/21/2024
2.0.1 127 07/21/2024
2.0.0 121 07/21/2024
2.0.0-preview2-final 123 07/21/2024
2.0.0-preview1-final 126 07/21/2024
1.1.3 116 07/21/2024
1.1.2 128 07/21/2024
1.1.1 114 07/21/2024
1.1.0 136 07/21/2024
1.1.0-preview1-final 132 07/21/2024
1.0.5 130 07/21/2024
1.0.4 134 07/21/2024
1.0.3 115 07/21/2024
1.0.2 130 07/21/2024
1.0.1 138 07/21/2024
1.0.0 135 07/21/2024
1.0.0-rc2-final 135 07/21/2024