Microsoft.AspNetCore.Authentication.OpenIdConnect 10.0.0-rc.1.25451.107

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
178
IdentityServer4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
80
IdentityServer4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
71
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
68
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
64
IdentityServer4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
64
Microsoft.AspNetCore.Diagnostics.Identity.Service
ASP.NET Core Identity Service Diagnostics Middleware.
64
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
63
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
61
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.
60
IdentityServer4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
59
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.
59
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
59
IdentityServer4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
58
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
58
Duende.IdentityServer
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
57

Version Downloads Last updated
10.0.0-rc.1.25451.107 5 09/11/2025
10.0.0-preview.7.25380.108 9 08/14/2025
10.0.0-preview.6.25358.103 11 07/16/2025
10.0.0-preview.5.25277.114 10 06/09/2025
10.0.0-preview.4.25258.110 19 05/13/2025
10.0.0-preview.3.25172.1 18 04/11/2025
10.0.0-preview.2.25164.1 20 03/20/2025
10.0.0-preview.1.25120.3 24 02/25/2025
9.0.9 2 09/11/2025
9.0.8 9 08/05/2025
9.0.7 12 07/10/2025
9.0.6 10 06/12/2025
9.0.5 18 05/16/2025
9.0.4 19 04/12/2025
9.0.3 18 03/15/2025
9.0.2 20 02/16/2025
9.0.1 25 01/20/2025
9.0.0 38 11/13/2024
9.0.0-rc.2.24474.3 34 10/19/2024
9.0.0-rc.1.24452.1 31 09/11/2024
9.0.0-preview.7.24406.2 38 08/13/2024
9.0.0-preview.6.24328.4 40 07/19/2024
9.0.0-preview.5.24306.11 36 06/13/2024
9.0.0-preview.4.24267.6 40 05/25/2024
9.0.0-preview.3.24172.13 35 04/13/2024
9.0.0-preview.2.24128.4 45 03/15/2024
9.0.0-preview.1.24081.5 42 02/24/2024
8.0.20 2 09/12/2025
8.0.19 8 08/05/2025
8.0.18 12 07/10/2025
8.0.17 11 06/12/2025
8.0.16 17 05/16/2025
8.0.15 20 04/13/2025
8.0.14 23 03/15/2025
8.0.13 22 02/12/2025
8.0.12 27 01/25/2025
8.0.11 34 11/13/2024
8.0.10 30 10/19/2024
8.0.8 39 08/13/2024
8.0.7 43 07/11/2024
8.0.6 43 05/30/2024
8.0.5 40 05/14/2024
8.0.4 45 04/10/2024
8.0.3 43 03/15/2024
8.0.2 44 03/11/2024
8.0.1 39 01/17/2024
8.0.0 53 11/16/2023
8.0.0-rc.2.23480.2 50 10/22/2023
8.0.0-rc.1.23421.29 41 09/22/2023
8.0.0-preview.7.23375.9 45 08/25/2023
8.0.0-preview.6.23329.11 43 07/23/2023
8.0.0-preview.5.23302.2 45 06/20/2023
8.0.0-preview.4.23260.4 44 05/29/2023
8.0.0-preview.3.23177.8 47 06/30/2023
8.0.0-preview.2.23153.2 47 04/02/2023
8.0.0-preview.1.23112.2 46 02/22/2023
7.0.20 45 06/02/2024
7.0.19 42 05/14/2024
7.0.18 43 04/10/2024
7.0.17 44 03/13/2024
7.0.16 43 03/11/2024
7.0.15 35 01/17/2024
7.0.14 43 11/15/2023
7.0.13 53 10/26/2023
7.0.12 43 10/28/2023
7.0.11 46 09/21/2023
7.0.10 44 08/29/2023
7.0.9 47 07/23/2023
7.0.8 53 07/11/2023
7.0.7 56 06/20/2023
7.0.5 51 06/11/2023
7.0.4 55 04/28/2023
7.0.3 52 04/09/2023
7.0.2 52 01/17/2023
7.0.1 54 12/23/2022
7.0.0 53 12/23/2022
7.0.0-rc.2.22476.2 42 06/30/2023
7.0.0-rc.1.22427.2 49 11/21/2022
7.0.0-preview.7.22376.6 46 11/15/2022
7.0.0-preview.6.22330.3 46 07/01/2023
7.0.0-preview.5.22303.8 51 11/09/2022
7.0.0-preview.4.22251.1 58 06/19/2022
7.0.0-preview.3.22178.4 50 07/19/2022
7.0.0-preview.2.22153.2 42 11/05/2022
7.0.0-preview.1.22109.13 46 06/11/2023
6.0.36 38 11/13/2024
6.0.35 31 10/19/2024
6.0.33 38 08/14/2024
6.0.32 35 07/11/2024
6.0.31 47 06/02/2024
6.0.30 38 05/14/2024
6.0.29 43 04/10/2024
6.0.28 48 03/15/2024
6.0.27 35 03/11/2024
6.0.26 40 01/17/2024
6.0.25 49 11/16/2023
6.0.24 44 10/26/2023
6.0.23 50 10/23/2023
6.0.22 44 09/21/2023
6.0.21 49 08/26/2023
6.0.20 52 07/24/2023
6.0.19 43 07/06/2023
6.0.18 59 06/20/2023
6.0.16 50 05/15/2023
6.0.15 53 04/25/2023
6.0.14 46 06/25/2023
6.0.13 48 04/02/2023
6.0.12 47 12/23/2022
6.0.11 48 12/23/2022
6.0.10 47 12/23/2022
6.0.9 47 01/14/2023
6.0.8 61 11/11/2022
6.0.7 57 02/26/2023
6.0.6 41 12/26/2022
6.0.5 55 09/16/2022
6.0.4 43 11/27/2022
6.0.3 44 10/27/2022
6.0.2 54 12/14/2022
6.0.1 47 12/21/2021
6.0.0 50 07/03/2022
6.0.0-rc.2.21480.10 49 06/29/2023
6.0.0-rc.1.21452.15 46 12/28/2022
6.0.0-preview.7.21378.6 46 12/26/2022
6.0.0-preview.6.21355.2 48 12/02/2022
6.0.0-preview.5.21301.17 53 05/24/2023
6.0.0-preview.4.21253.5 47 05/11/2023
6.0.0-preview.3.21201.13 44 06/28/2023
6.0.0-preview.2.21154.6 47 11/16/2022
6.0.0-preview.1.21103.6 45 11/15/2022
5.0.17 46 11/24/2022
5.0.16 50 11/24/2022
5.0.15 50 12/21/2022
5.0.14 57 12/12/2022
5.0.13 58 10/04/2022
5.0.12 48 12/30/2022
5.0.11 49 12/16/2022
5.0.10 48 11/28/2022
5.0.9 49 12/24/2022
5.0.8 69 10/10/2022
5.0.7 48 11/15/2022
5.0.6 52 10/29/2022
5.0.5 44 10/28/2022
5.0.4 55 11/27/2022
5.0.3 46 12/17/2022
5.0.2 53 12/21/2022
5.0.1 59 11/18/2022
5.0.0 60 12/21/2022
5.0.0-rc.2.20475.17 40 11/08/2022
5.0.0-rc.1.20451.17 42 06/29/2023
5.0.0-preview.8.20414.8 48 12/03/2022
5.0.0-preview.7.20365.19 48 06/29/2023
5.0.0-preview.6.20312.15 42 11/28/2022
5.0.0-preview.5.20279.2 38 06/29/2023
5.0.0-preview.4.20257.10 41 06/23/2023
5.0.0-preview.3.20215.14 47 06/28/2023
5.0.0-preview.2.20167.3 50 12/30/2022
5.0.0-preview.1.20124.5 45 10/10/2022
3.1.32 51 12/23/2022
3.1.31 49 02/20/2023
3.1.30 48 04/04/2023
3.1.29 48 12/18/2022
3.1.28 42 12/21/2022
3.1.27 43 12/24/2022
3.1.26 50 03/31/2023
3.1.25 55 11/10/2022
3.1.24 44 12/24/2022
3.1.23 55 01/08/2023
3.1.22 56 10/13/2022
3.1.21 46 11/10/2022
3.1.20 51 10/31/2022
3.1.19 56 08/01/2022
3.1.18 56 12/23/2022
3.1.17 49 01/15/2023
3.1.16 52 02/27/2023
3.1.15 53 11/08/2022
3.1.14 56 06/24/2022
3.1.13 67 01/03/2022
3.1.12 48 11/18/2022
3.1.11 50 12/16/2022
3.1.10 49 11/06/2022
3.1.9 43 12/26/2022
3.1.8 46 12/21/2022
3.1.7 64 06/29/2022
3.1.6 56 11/24/2022
3.1.5 56 11/08/2022
3.1.4 59 11/26/2022
3.1.3 52 09/30/2022
3.1.2 51 08/08/2022
3.1.1 41 12/10/2022
3.1.0 71 11/09/2020
3.1.0-preview3.19555.2 42 06/30/2023
3.1.0-preview2.19528.8 42 05/05/2023
3.1.0-preview1.19508.20 45 06/16/2022
3.0.3 51 10/20/2022
3.0.2 57 11/08/2022
3.0.0 52 09/02/2022
3.0.0-rc1.19457.4 44 06/24/2023
3.0.0-preview9.19424.4 48 11/13/2022
3.0.0-preview8.19405.7 55 06/30/2023
3.0.0-preview7.19365.7 47 06/27/2023
3.0.0-preview6.19307.2 53 06/29/2023
3.0.0-preview5-19227-01 45 02/17/2023
3.0.0-preview4-19216-03 56 12/13/2022
3.0.0-preview3-19153-02 49 09/30/2022
3.0.0-preview-19075-0444 49 12/11/2022
2.3.0 28 01/19/2025
2.2.0 58 11/05/2022
2.2.0-preview3-35497 59 07/18/2022
2.2.0-preview2-35157 51 06/28/2023
2.2.0-preview1-35029 49 12/17/2022
2.1.2 47 12/18/2022
2.1.1 61 07/02/2022
2.1.0 50 12/30/2022
2.1.0-rc1-final 48 12/17/2022
2.1.0-preview2-final 47 11/10/2022
2.1.0-preview1-final 55 11/13/2022
2.0.4 50 12/30/2022
2.0.3 48 12/30/2022
2.0.1 46 11/25/2022
2.0.0 58 12/15/2022
2.0.0-preview2-final 61 01/22/2023
2.0.0-preview1-final 47 07/10/2022
1.1.3 54 11/16/2022
1.1.2 59 11/13/2022
1.1.1 52 12/18/2022
1.1.0 59 12/15/2022
1.1.0-preview1-final 46 02/04/2023
1.0.5 59 11/21/2022
1.0.4 52 11/14/2022
1.0.3 46 12/16/2022
1.0.2 42 10/31/2022
1.0.1 55 12/05/2022
1.0.0 64 07/04/2022
1.0.0-rc2-final 47 07/27/2022