Microsoft.AspNetCore.Authentication.JwtBearer 9.0.0-rc.2.24474.3

Prefix Reserved
This is a prerelease version of Microsoft.AspNetCore.Authentication.JwtBearer.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer --version 9.0.0-rc.2.24474.3                
NuGet\Install-Package Microsoft.AspNetCore.Authentication.JwtBearer -Version 9.0.0-rc.2.24474.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0-rc.2.24474.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.AspNetCore.Authentication.JwtBearer --version 9.0.0-rc.2.24474.3                
#r "nuget: Microsoft.AspNetCore.Authentication.JwtBearer, 9.0.0-rc.2.24474.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Microsoft.AspNetCore.Authentication.JwtBearer as a Cake Addin
#addin nuget:?package=Microsoft.AspNetCore.Authentication.JwtBearer&version=9.0.0-rc.2.24474.3&prerelease

// Install Microsoft.AspNetCore.Authentication.JwtBearer as a Cake Tool
#tool nuget:?package=Microsoft.AspNetCore.Authentication.JwtBearer&version=9.0.0-rc.2.24474.3&prerelease                

About

Microsoft.AspNetCore.Authentication.JwtBearer is a middleware component designed for ASP.NET Core applications. It facilitates JSON Web Token (JWT) authentication, enabling secure authentication for APIs and web services. This package allows you to validate JWT tokens issued by an authentication server, ensuring secure access to your application's resources.

Key Features

  • Seamless integration with ASP.NET Core applications.
  • Supports JSON Web Token (JWT) authentication.
  • Enables secure authentication for APIs and web services.
  • Flexible configuration options for token validation parameters.
  • Works with .NET Core 3.0 and newer, as well as .NET Standard 2.1.

How to Use

using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;
using System.Text;

public void ConfigureServices(IServiceCollection services)
{
    services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
        .AddJwtBearer(options =>
        {
            options.TokenValidationParameters = new TokenValidationParameters
            {
                ValidateIssuer = true,
                ValidateAudience = true,
                ValidateLifetime = true,
                ValidateIssuerSigningKey = true,
                ValidIssuer = "your_issuer",
                ValidAudience = "your_audience",
                IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("your_secret_key"))
            };
        });

    // Other configurations...
}

For more detailed configuration options and advanced scenarios, please refer to the blog JWT Validation and Authorization in ASP.NET Core.

Main Types

The main types provided by this library are:

  • JwtBearerDefaults: Contains default values for JWT Bearer authentication.
  • JwtBearerEvents: Events used to handle JWT Bearer authentication events.
  • JwtBearerHandler: Handles JWT Bearer authentication requests.
  • wtBearerOptions: Options for configuring JWT Bearer authentication.

Additional Documentation

Feedback & Contributing

Microsoft.AspNetCore.Authentication.JwtBearer is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2.6K)

Showing the top 5 NuGet packages that depend on Microsoft.AspNetCore.Authentication.JwtBearer:

Package Downloads
IdentityServer4.AccessTokenValidation

ASP.NET Core authentication handler to validate JWT and reference tokens from IdentityServer4

Microsoft.Identity.Web.TokenAcquisition

Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).

Microsoft.AspNetCore.App

Provides a default set of APIs for building an ASP.NET Core application. 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.

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.

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/ab1f1c636afa3a6607f2d67bc387b586596d1d38

GitHub repositories (422)

Showing the top 5 popular GitHub repositories that depend on Microsoft.AspNetCore.Authentication.JwtBearer:

Repository Stars
bitwarden/server
Bitwarden infrastructure/backend (API, database, Docker, etc).
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
duplicati/duplicati
Store securely encrypted backups in the cloud!
dotnet-architecture/eShopOnWeb
Sample ASP.NET Core 8.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.
Version Downloads Last updated
9.0.0 40,684 11/12/2024
9.0.0-rc.2.24474.3 41,008 10/8/2024
9.0.0-rc.1.24452.1 32,373 9/10/2024
9.0.0-preview.7.24406.2 8,174 8/13/2024
9.0.0-preview.6.24328.4 26,284 7/9/2024
9.0.0-preview.5.24306.11 5,691 6/11/2024
9.0.0-preview.4.24267.6 11,478 5/21/2024
9.0.0-preview.3.24172.13 79,581 4/11/2024
9.0.0-preview.2.24128.4 25,653 3/12/2024
9.0.0-preview.1.24081.5 26,054 2/13/2024
8.0.11 74,795 11/12/2024
8.0.10 2,933,032 10/8/2024
8.0.8 6,865,984 8/13/2024
8.0.7 5,620,452 7/9/2024
8.0.6 7,080,116 5/28/2024
8.0.5 2,656,621 5/14/2024
8.0.4 6,664,241 4/9/2024
8.0.3 4,848,469 3/12/2024
8.0.2 5,707,400 2/13/2024
8.0.1 6,990,666 1/9/2024
8.0.0 20,837,878 11/14/2023
8.0.0-rc.2.23480.2 398,239 10/10/2023
8.0.0-rc.1.23421.29 92,604 9/12/2023
8.0.0-preview.7.23375.9 173,713 8/8/2023
8.0.0-preview.6.23329.11 61,626 7/11/2023
8.0.0-preview.5.23302.2 11,265 6/13/2023
8.0.0-preview.4.23260.4 10,249 5/16/2023
8.0.0-preview.3.23177.8 16,516 4/11/2023
8.0.0-preview.2.23153.2 7,885 3/14/2023
8.0.0-preview.1.23112.2 59,204 2/21/2023
7.0.20 670,220 5/28/2024
7.0.19 102,711 5/14/2024
7.0.18 328,863 4/9/2024
7.0.17 354,130 3/12/2024
7.0.16 575,232 2/13/2024
7.0.15 1,011,923 1/9/2024
7.0.14 2,053,284 11/14/2023
7.0.13 2,378,098 10/24/2023
7.0.12 1,780,758 10/10/2023
7.0.11 2,600,919 9/12/2023
7.0.10 3,648,749 8/8/2023
7.0.9 2,669,326 7/11/2023
7.0.8 2,251,458 6/22/2023
7.0.7 1,185,444 6/13/2023
7.0.5 6,949,685 4/11/2023
7.0.4 3,448,615 3/14/2023
7.0.3 3,312,204 2/14/2023
7.0.2 4,140,058 1/10/2023
7.0.1 8,726,741 12/13/2022
7.0.0 5,061,359 11/7/2022
7.0.0-rc.2.22476.2 84,134 10/11/2022
7.0.0-rc.1.22427.2 23,492 9/14/2022
7.0.0-preview.7.22376.6 23,150 8/9/2022
7.0.0-preview.6.22330.3 217,582 7/12/2022
7.0.0-preview.5.22303.8 6,102 6/14/2022
7.0.0-preview.4.22251.1 10,360 5/10/2022
7.0.0-preview.3.22178.4 4,357 4/13/2022
7.0.0-preview.2.22153.2 3,869 3/14/2022
7.0.0-preview.1.22109.13 3,311 2/17/2022
6.0.36 10,304 11/12/2024
6.0.35 153,455 10/8/2024
6.0.33 579,993 8/13/2024
6.0.32 517,127 7/9/2024
6.0.31 702,956 5/28/2024
6.0.30 348,460 5/14/2024
6.0.29 1,107,613 4/9/2024
6.0.28 1,005,744 3/12/2024
6.0.27 1,287,250 2/13/2024
6.0.26 2,461,021 1/9/2024
6.0.25 3,259,723 11/14/2023
6.0.24 1,974,657 10/24/2023
6.0.23 979,178 10/10/2023
6.0.22 1,826,986 9/12/2023
6.0.21 2,607,820 8/8/2023
6.0.20 2,467,437 7/11/2023
6.0.19 1,626,551 6/22/2023
6.0.18 823,896 6/13/2023
6.0.16 6,719,747 4/11/2023
6.0.15 4,056,245 3/14/2023
6.0.14 4,416,829 2/14/2023
6.0.13 6,991,310 1/10/2023
6.0.12 10,382,127 12/13/2022
6.0.11 7,428,046 11/7/2022
6.0.10 11,464,149 10/11/2022
6.0.9 8,707,928 9/13/2022
6.0.8 10,892,075 8/9/2022
6.0.7 8,795,843 7/12/2022
6.0.6 7,125,176 6/14/2022
6.0.5 10,123,406 5/10/2022
6.0.4 7,984,947 4/11/2022
6.0.3 9,388,222 3/8/2022
6.0.2 7,325,321 2/8/2022
6.0.1 12,533,806 12/14/2021
6.0.0 12,472,327 11/8/2021
6.0.0-rc.2.21480.10 74,774 10/12/2021
6.0.0-rc.1.21452.15 59,430 9/14/2021
6.0.0-preview.7.21378.6 65,221 8/10/2021
6.0.0-preview.6.21355.2 19,054 7/14/2021
6.0.0-preview.5.21301.17 11,521 6/15/2021
6.0.0-preview.4.21253.5 9,809 5/24/2021
6.0.0-preview.3.21201.13 13,512 4/8/2021
6.0.0-preview.2.21154.6 3,889 3/11/2021 6.0.0-preview.2.21154.6 is deprecated because it is no longer maintained.
6.0.0-preview.1.21103.6 6,341 2/12/2021 6.0.0-preview.1.21103.6 is deprecated because it is no longer maintained.
5.0.17 2,606,149 5/10/2022 5.0.17 is deprecated because it is no longer maintained.
5.0.16 641,547 4/11/2022 5.0.16 is deprecated because it is no longer maintained.
5.0.15 999,360 3/8/2022 5.0.15 is deprecated because it is no longer maintained.
5.0.14 939,120 2/8/2022 5.0.14 is deprecated because it is no longer maintained.
5.0.13 2,497,651 12/14/2021 5.0.13 is deprecated because it is no longer maintained.
5.0.12 20,155,777 11/7/2021 5.0.12 is deprecated because it is no longer maintained.
5.0.11 3,844,760 10/12/2021 5.0.11 is deprecated because it is no longer maintained.
5.0.10 3,877,723 9/14/2021 5.0.10 is deprecated because it is no longer maintained.
5.0.9 7,344,140 8/10/2021 5.0.9 is deprecated because it is no longer maintained.
5.0.8 2,867,046 7/13/2021 5.0.8 is deprecated because it is no longer maintained; 5.0.8 has at least one vulnerability with moderate severity.
5.0.7 4,117,428 6/8/2021 5.0.7 is deprecated because it is no longer maintained; 5.0.7 has at least one vulnerability with moderate severity.
5.0.6 2,927,482 5/11/2021 5.0.6 is deprecated because it is no longer maintained; 5.0.6 has at least one vulnerability with moderate severity.
5.0.5 4,141,193 4/6/2021 5.0.5 is deprecated because it is no longer maintained; 5.0.5 has at least one vulnerability with moderate severity.
5.0.4 2,949,870 3/9/2021 5.0.4 is deprecated because it is no longer maintained; 5.0.4 has at least one vulnerability with moderate severity.
5.0.3 3,125,778 2/9/2021 5.0.3 is deprecated because it is no longer maintained; 5.0.3 has at least one vulnerability with moderate severity.
5.0.2 2,797,265 1/12/2021 5.0.2 is deprecated because it is no longer maintained; 5.0.2 has at least one vulnerability with moderate severity.
5.0.1 3,152,643 12/8/2020 5.0.1 is deprecated because it is no longer maintained; 5.0.1 has at least one vulnerability with moderate severity.
5.0.0 10,776,858 11/9/2020 5.0.0 is deprecated because it is no longer maintained; 5.0.0 has at least one vulnerability with moderate severity.
5.0.0-rc.2.20475.17 105,977 10/13/2020 5.0.0-rc.2.20475.17 is deprecated because it is no longer maintained.
5.0.0-rc.1.20451.17 270,069 9/14/2020 5.0.0-rc.1.20451.17 is deprecated because it is no longer maintained.
5.0.0-preview.8.20414.8 1,144,866 8/25/2020 5.0.0-preview.8.20414.8 is deprecated because it is no longer maintained.
5.0.0-preview.7.20365.19 16,596 7/21/2020 5.0.0-preview.7.20365.19 is deprecated because it is no longer maintained.
5.0.0-preview.6.20312.15 20,491 6/25/2020 5.0.0-preview.6.20312.15 is deprecated because it is no longer maintained.
5.0.0-preview.5.20279.2 3,436 6/10/2020 5.0.0-preview.5.20279.2 is deprecated because it is no longer maintained.
5.0.0-preview.4.20257.10 4,281 5/18/2020 5.0.0-preview.4.20257.10 is deprecated because it is no longer maintained.
5.0.0-preview.3.20215.14 4,387 4/23/2020 5.0.0-preview.3.20215.14 is deprecated because it is no longer maintained.
5.0.0-preview.2.20167.3 3,457 4/2/2020 5.0.0-preview.2.20167.3 is deprecated because it is no longer maintained.
5.0.0-preview.1.20124.5 5,479 3/16/2020 5.0.0-preview.1.20124.5 is deprecated because it is no longer maintained.
3.1.32 2,021,766 12/13/2022
3.1.31 257,476 11/8/2022
3.1.30 204,787 10/11/2022
3.1.29 246,407 9/13/2022
3.1.28 2,008,805 8/9/2022
3.1.27 352,652 7/12/2022
3.1.26 340,686 6/14/2022
3.1.25 629,471 5/10/2022
3.1.24 453,029 4/11/2022
3.1.23 1,913,576 3/8/2022
3.1.22 3,027,737 12/14/2021
3.1.21 2,193,046 11/7/2021
3.1.20 976,067 10/11/2021
3.1.19 1,216,444 9/14/2021
3.1.18 7,718,088 8/10/2021
3.1.17 1,086,904 7/13/2021 3.1.17 has at least one vulnerability with moderate severity.
3.1.16 2,143,445 6/8/2021 3.1.16 has at least one vulnerability with moderate severity.
3.1.15 1,583,923 5/11/2021 3.1.15 has at least one vulnerability with moderate severity.
3.1.14 2,023,197 4/6/2021 3.1.14 has at least one vulnerability with moderate severity.
3.1.13 2,333,497 3/9/2021 3.1.13 has at least one vulnerability with moderate severity.
3.1.12 2,110,130 2/9/2021 3.1.12 has at least one vulnerability with moderate severity.
3.1.11 3,452,160 1/12/2021 3.1.11 has at least one vulnerability with moderate severity.
3.1.10 5,608,443 11/9/2020 3.1.10 has at least one vulnerability with moderate severity.
3.1.9 6,138,323 10/13/2020 3.1.9 has at least one vulnerability with moderate severity.
3.1.8 10,497,781 9/8/2020 3.1.8 has at least one vulnerability with moderate severity.
3.1.7 4,683,275 8/11/2020 3.1.7 has at least one vulnerability with moderate severity.
3.1.6 5,496,063 7/14/2020 3.1.6 has at least one vulnerability with moderate severity.
3.1.5 7,851,218 6/9/2020 3.1.5 has at least one vulnerability with moderate severity.
3.1.4 7,164,621 5/12/2020 3.1.4 has at least one vulnerability with moderate severity.
3.1.3 9,452,511 3/24/2020 3.1.3 has at least one vulnerability with moderate severity.
3.1.2 7,078,961 2/18/2020 3.1.2 has at least one vulnerability with moderate severity.
3.1.1 9,420,144 1/14/2020 3.1.1 has at least one vulnerability with moderate severity.
3.1.0 7,208,427 12/3/2019 3.1.0 has at least one vulnerability with moderate severity.
3.1.0-preview3.19555.2 13,571 11/13/2019 3.1.0-preview3.19555.2 is deprecated because it is no longer maintained; 3.1.0-preview3.19555.2 has at least one vulnerability with moderate severity.
3.1.0-preview2.19528.8 3,364 11/1/2019 3.1.0-preview2.19528.8 is deprecated because it is no longer maintained; 3.1.0-preview2.19528.8 has at least one vulnerability with moderate severity.
3.1.0-preview1.19508.20 7,336 10/15/2019 3.1.0-preview1.19508.20 is deprecated because it is no longer maintained; 3.1.0-preview1.19508.20 has at least one vulnerability with moderate severity.
3.0.3 670,880 2/18/2020 3.0.3 is deprecated because it is no longer maintained; 3.0.3 has at least one vulnerability with moderate severity.
3.0.2 285,758 1/14/2020 3.0.2 is deprecated because it is no longer maintained; 3.0.2 has at least one vulnerability with moderate severity.
3.0.0 38,833,653 9/23/2019 3.0.0 is deprecated because it is no longer maintained; 3.0.0 has at least one vulnerability with moderate severity.
3.0.0-rc1.19457.4 24,966 9/16/2019 3.0.0-rc1.19457.4 is deprecated because it is no longer maintained.
3.0.0-preview9.19424.4 146,904 9/4/2019 3.0.0-preview9.19424.4 is deprecated because it is no longer maintained.
3.0.0-preview8.19405.7 27,848 8/13/2019 3.0.0-preview8.19405.7 is deprecated because it is no longer maintained.
3.0.0-preview7.19365.7 40,095 7/23/2019 3.0.0-preview7.19365.7 is deprecated because it is no longer maintained.
3.0.0-preview6.19307.2 36,443 6/12/2019 3.0.0-preview6.19307.2 is deprecated because it is no longer maintained.
3.0.0-preview5-19227-01 24,002 5/6/2019 3.0.0-preview5-19227-01 is deprecated because it is no longer maintained.
3.0.0-preview4-19216-03 6,978 4/18/2019 3.0.0-preview4-19216-03 is deprecated because it is no longer maintained.
3.0.0-preview3-19153-02 7,721 3/6/2019 3.0.0-preview3-19153-02 is deprecated because it is no longer maintained.
3.0.0-preview-19075-0444 12,275 1/29/2019 3.0.0-preview-19075-0444 is deprecated because it is no longer maintained.
2.2.0 28,222,565 12/3/2018 2.2.0 is deprecated because it is no longer maintained.
2.2.0-preview3-35497 71,398 10/17/2018 2.2.0-preview3-35497 is deprecated because it is no longer maintained.
2.2.0-preview2-35157 36,004 9/12/2018 2.2.0-preview2-35157 is deprecated because it is no longer maintained.
2.2.0-preview1-35029 8,883 8/22/2018 2.2.0-preview1-35029 is deprecated because it is no longer maintained.
2.1.30 950,449 8/19/2021
2.1.2 17,450,462 8/21/2018 2.1.2 has at least one vulnerability with moderate severity.
2.1.1 11,594,633 6/18/2018 2.1.1 has at least one vulnerability with moderate severity.
2.1.0 14,939,654 5/29/2018 2.1.0 has at least one vulnerability with moderate severity.
2.1.0-rc1-final 40,916 5/6/2018 2.1.0-rc1-final is deprecated because it is no longer maintained.
2.1.0-preview2-final 38,713 4/10/2018 2.1.0-preview2-final is deprecated because it is no longer maintained.
2.1.0-preview1-final 53,734 2/26/2018 2.1.0-preview1-final is deprecated because it is no longer maintained.
2.0.4 4,529,043 5/7/2018 2.0.4 is deprecated because it is no longer maintained.
2.0.3 4,158,955 3/13/2018 2.0.3 is deprecated because it is no longer maintained.
2.0.1 7,431,139 11/14/2017 2.0.1 is deprecated because it is no longer maintained.
2.0.0 12,092,420 8/11/2017 2.0.0 is deprecated because it is no longer maintained.
2.0.0-preview2-final 55,749 6/27/2017 2.0.0-preview2-final is deprecated because it is no longer maintained.
2.0.0-preview1-final 17,759 5/10/2017 2.0.0-preview1-final is deprecated because it is no longer maintained.
1.1.3 469,839 9/20/2017 1.1.3 is deprecated because it is no longer maintained.
1.1.2 1,249,274 5/9/2017 1.1.2 is deprecated because it is no longer maintained.
1.1.1 472,244 3/6/2017 1.1.1 is deprecated because it is no longer maintained.
1.1.0 396,268 11/16/2016 1.1.0 is deprecated because it is no longer maintained.
1.1.0-preview1-final 6,517 10/24/2016 1.1.0-preview1-final is deprecated because it is no longer maintained.
1.0.5 12,467 11/14/2017 1.0.5 is deprecated because it is no longer maintained.
1.0.4 6,489 9/20/2017 1.0.4 is deprecated because it is no longer maintained.
1.0.3 18,089 5/9/2017 1.0.3 is deprecated because it is no longer maintained.
1.0.2 115,685 3/6/2017 1.0.2 is deprecated because it is no longer maintained.
1.0.1 21,761 12/12/2016 1.0.1 is deprecated because it is no longer maintained.
1.0.0 714,562 6/27/2016 1.0.0 is deprecated because it is no longer maintained.
1.0.0-rc2-final 19,514 5/16/2016 1.0.0-rc2-final is deprecated because it is no longer maintained.