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

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
27
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 at: https://github.com/aspnet/AADIntegration/tree/1c7e5d489d03b6e11fb529661062d1b4eba62e3a
30
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 at: https://github.com/aspnet/AADIntegration/tree/b252a87119d5979b49cec1a57dbbb0e0f356f79a
28
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
31
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
28
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/5502cf46706a25c39ce78a57b9191714c0eb40c2
28
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
28
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/fbe05294ac5c88be848b4d57d60cb2657874da9b
28
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
27
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
29
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/6939d9ab90aa1e57bb0619bb28819f7bcbfdbb54
27
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/98a853b20131fd59b37076dd3699d8c7f62b24cb
29
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/b92c9f50f0333ea661785ba849f303cde6a93844
29
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/c0ae1d179dba6f3acd0e55be55718c97c9028698
28
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/d827c653b787c07de908240b7746ce34d3e6271e
27
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/ecdcc752d4639061c2c49727ee77a1039bbbca22
27
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.
32
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
28
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
31
Microsoft.Identity.Web.UI
This package enables UI for ASP.NET Core Web apps that use Microsoft.Identity.Web.
27

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