Microsoft.AspNetCore.Authentication.JwtBearer
9.0.0
Prefix Reserved
dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer --version 9.0.0
NuGet\Install-Package Microsoft.AspNetCore.Authentication.JwtBearer -Version 9.0.0
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
paket add Microsoft.AspNetCore.Authentication.JwtBearer --version 9.0.0
#r "nuget: Microsoft.AspNetCore.Authentication.JwtBearer, 9.0.0"
// Install Microsoft.AspNetCore.Authentication.JwtBearer as a Cake Addin #addin nuget:?package=Microsoft.AspNetCore.Authentication.JwtBearer&version=9.0.0 // Install Microsoft.AspNetCore.Authentication.JwtBearer as a Cake Tool #tool nuget:?package=Microsoft.AspNetCore.Authentication.JwtBearer&version=9.0.0
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
-
net9.0
NuGet packages (2.7K)
Showing the top 5 NuGet packages that depend on Microsoft.AspNetCore.Authentication.JwtBearer:
Package | Downloads |
---|---|
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 |
|
Okta.AspNetCore
Official Okta middleware for ASP.NET Core 3.1+. Easily add authentication and authorization to ASP.NET Core applications. |
GitHub repositories (429)
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 | 1,226,923 | 11/12/2024 | |
9.0.0-rc.2.24474.3 | 96,003 | 10/8/2024 | |
9.0.0-rc.1.24452.1 | 47,541 | 9/10/2024 | |
9.0.0-preview.7.24406.2 | 8,714 | 8/13/2024 | |
9.0.0-preview.6.24328.4 | 31,333 | 7/9/2024 | |
9.0.0-preview.5.24306.11 | 5,748 | 6/11/2024 | |
9.0.0-preview.4.24267.6 | 11,584 | 5/21/2024 | |
9.0.0-preview.3.24172.13 | 79,731 | 4/11/2024 | |
9.0.0-preview.2.24128.4 | 25,760 | 3/12/2024 | |
9.0.0-preview.1.24081.5 | 26,737 | 2/13/2024 | |
8.0.11 | 2,044,505 | 11/12/2024 | |
8.0.10 | 5,638,626 | 10/8/2024 | |
8.0.8 | 8,702,032 | 8/13/2024 | |
8.0.7 | 6,676,939 | 7/9/2024 | |
8.0.6 | 8,135,219 | 5/28/2024 | |
8.0.5 | 2,946,877 | 5/14/2024 | |
8.0.4 | 7,447,446 | 4/9/2024 | |
8.0.3 | 5,310,384 | 3/12/2024 | |
8.0.2 | 6,199,317 | 2/13/2024 | |
8.0.1 | 7,498,417 | 1/9/2024 | |
8.0.0 | 23,764,978 | 11/14/2023 | |
8.0.0-rc.2.23480.2 | 430,175 | 10/10/2023 | |
8.0.0-rc.1.23421.29 | 96,031 | 9/12/2023 | |
8.0.0-preview.7.23375.9 | 200,102 | 8/8/2023 | |
8.0.0-preview.6.23329.11 | 68,659 | 7/11/2023 | |
8.0.0-preview.5.23302.2 | 11,478 | 6/13/2023 | |
8.0.0-preview.4.23260.4 | 10,819 | 5/16/2023 | |
8.0.0-preview.3.23177.8 | 17,577 | 4/11/2023 | |
8.0.0-preview.2.23153.2 | 8,249 | 3/14/2023 | |
8.0.0-preview.1.23112.2 | 59,495 | 2/21/2023 | |
7.0.20 | 864,057 | 5/28/2024 | |
7.0.19 | 114,383 | 5/14/2024 | |
7.0.18 | 362,160 | 4/9/2024 | |
7.0.17 | 381,405 | 3/12/2024 | |
7.0.16 | 606,822 | 2/13/2024 | |
7.0.15 | 1,073,752 | 1/9/2024 | |
7.0.14 | 2,136,093 | 11/14/2023 | |
7.0.13 | 2,452,612 | 10/24/2023 | |
7.0.12 | 1,853,984 | 10/10/2023 | |
7.0.11 | 2,688,615 | 9/12/2023 | |
7.0.10 | 3,745,551 | 8/8/2023 | |
7.0.9 | 2,732,420 | 7/11/2023 | |
7.0.8 | 2,290,461 | 6/22/2023 | |
7.0.7 | 1,209,430 | 6/13/2023 | |
7.0.5 | 7,095,148 | 4/11/2023 | |
7.0.4 | 3,500,703 | 3/14/2023 | |
7.0.3 | 3,375,208 | 2/14/2023 | |
7.0.2 | 4,256,280 | 1/10/2023 | |
7.0.1 | 8,941,208 | 12/13/2022 | |
7.0.0 | 5,189,117 | 11/7/2022 | |
7.0.0-rc.2.22476.2 | 84,890 | 10/11/2022 | |
7.0.0-rc.1.22427.2 | 23,867 | 9/14/2022 | |
7.0.0-preview.7.22376.6 | 23,612 | 8/9/2022 | |
7.0.0-preview.6.22330.3 | 235,666 | 7/12/2022 | |
7.0.0-preview.5.22303.8 | 6,150 | 6/14/2022 | |
7.0.0-preview.4.22251.1 | 10,386 | 5/10/2022 | |
7.0.0-preview.3.22178.4 | 4,381 | 4/13/2022 | |
7.0.0-preview.2.22153.2 | 3,892 | 3/14/2022 | |
7.0.0-preview.1.22109.13 | 3,345 | 2/17/2022 | |
6.0.36 | 161,179 | 11/12/2024 | |
6.0.35 | 282,648 | 10/8/2024 | |
6.0.33 | 812,704 | 8/13/2024 | |
6.0.32 | 665,261 | 7/9/2024 | |
6.0.31 | 798,088 | 5/28/2024 | |
6.0.30 | 392,980 | 5/14/2024 | |
6.0.29 | 1,254,088 | 4/9/2024 | |
6.0.28 | 1,089,851 | 3/12/2024 | |
6.0.27 | 1,383,415 | 2/13/2024 | |
6.0.26 | 2,611,419 | 1/9/2024 | |
6.0.25 | 3,398,939 | 11/14/2023 | |
6.0.24 | 2,041,080 | 10/24/2023 | |
6.0.23 | 1,017,951 | 10/10/2023 | |
6.0.22 | 1,903,148 | 9/12/2023 | |
6.0.21 | 2,697,868 | 8/8/2023 | |
6.0.20 | 2,551,977 | 7/11/2023 | |
6.0.19 | 1,671,455 | 6/22/2023 | |
6.0.18 | 844,413 | 6/13/2023 | |
6.0.16 | 6,928,768 | 4/11/2023 | |
6.0.15 | 4,241,496 | 3/14/2023 | |
6.0.14 | 4,529,990 | 2/14/2023 | |
6.0.13 | 7,234,022 | 1/10/2023 | |
6.0.12 | 10,752,810 | 12/13/2022 | |
6.0.11 | 7,637,145 | 11/7/2022 | |
6.0.10 | 11,703,730 | 10/11/2022 | |
6.0.9 | 8,877,361 | 9/13/2022 | |
6.0.8 | 11,094,499 | 8/9/2022 | |
6.0.7 | 8,985,107 | 7/12/2022 | |
6.0.6 | 7,252,141 | 6/14/2022 | |
6.0.5 | 10,288,245 | 5/10/2022 | |
6.0.4 | 8,119,324 | 4/11/2022 | |
6.0.3 | 9,515,955 | 3/8/2022 | |
6.0.2 | 7,418,354 | 2/8/2022 | |
6.0.1 | 12,739,078 | 12/14/2021 | |
6.0.0 | 12,777,767 | 11/8/2021 | |
6.0.0-rc.2.21480.10 | 75,273 | 10/12/2021 | |
6.0.0-rc.1.21452.15 | 59,717 | 9/14/2021 | |
6.0.0-preview.7.21378.6 | 66,541 | 8/10/2021 | |
6.0.0-preview.6.21355.2 | 19,165 | 7/14/2021 | |
6.0.0-preview.5.21301.17 | 11,588 | 6/15/2021 | |
6.0.0-preview.4.21253.5 | 9,847 | 5/24/2021 | |
6.0.0-preview.3.21201.13 | 13,607 | 4/8/2021 | |
6.0.0-preview.2.21154.6 | 3,917 | 3/11/2021 | |
6.0.0-preview.1.21103.6 | 6,391 | 2/12/2021 | |
5.0.17 | 2,683,669 | 5/10/2022 | |
5.0.16 | 647,832 | 4/11/2022 | |
5.0.15 | 1,022,328 | 3/8/2022 | |
5.0.14 | 949,113 | 2/8/2022 | |
5.0.13 | 2,526,359 | 12/14/2021 | |
5.0.12 | 20,500,893 | 11/7/2021 | |
5.0.11 | 3,873,635 | 10/12/2021 | |
5.0.10 | 3,910,432 | 9/14/2021 | |
5.0.9 | 7,409,518 | 8/10/2021 | |
5.0.8 | 2,881,793 | 7/13/2021 | |
5.0.7 | 4,140,297 | 6/8/2021 | |
5.0.6 | 2,954,094 | 5/11/2021 | |
5.0.5 | 4,169,117 | 4/6/2021 | |
5.0.4 | 2,964,576 | 3/9/2021 | |
5.0.3 | 3,138,633 | 2/9/2021 | |
5.0.2 | 2,837,376 | 1/12/2021 | |
5.0.1 | 3,171,506 | 12/8/2020 | |
5.0.0 | 10,966,420 | 11/9/2020 | |
5.0.0-rc.2.20475.17 | 106,849 | 10/13/2020 | |
5.0.0-rc.1.20451.17 | 281,892 | 9/14/2020 | |
5.0.0-preview.8.20414.8 | 1,902,060 | 8/25/2020 | |
5.0.0-preview.7.20365.19 | 16,640 | 7/21/2020 | |
5.0.0-preview.6.20312.15 | 20,656 | 6/25/2020 | |
5.0.0-preview.5.20279.2 | 3,464 | 6/10/2020 | |
5.0.0-preview.4.20257.10 | 4,309 | 5/18/2020 | |
5.0.0-preview.3.20215.14 | 4,413 | 4/23/2020 | |
5.0.0-preview.2.20167.3 | 3,481 | 4/2/2020 | |
5.0.0-preview.1.20124.5 | 5,504 | 3/16/2020 | |
3.1.32 | 2,159,586 | 12/13/2022 | |
3.1.31 | 265,562 | 11/8/2022 | |
3.1.30 | 208,333 | 10/11/2022 | |
3.1.29 | 253,287 | 9/13/2022 | |
3.1.28 | 2,086,827 | 8/9/2022 | |
3.1.27 | 358,467 | 7/12/2022 | |
3.1.26 | 345,378 | 6/14/2022 | |
3.1.25 | 639,960 | 5/10/2022 | |
3.1.24 | 461,041 | 4/11/2022 | |
3.1.23 | 1,967,273 | 3/8/2022 | |
3.1.22 | 3,088,851 | 12/14/2021 | |
3.1.21 | 2,211,946 | 11/7/2021 | |
3.1.20 | 987,911 | 10/11/2021 | |
3.1.19 | 1,226,030 | 9/14/2021 | |
3.1.18 | 7,882,119 | 8/10/2021 | |
3.1.17 | 1,095,305 | 7/13/2021 | |
3.1.16 | 2,160,712 | 6/8/2021 | |
3.1.15 | 1,594,428 | 5/11/2021 | |
3.1.14 | 2,039,874 | 4/6/2021 | |
3.1.13 | 2,347,207 | 3/9/2021 | |
3.1.12 | 2,122,862 | 2/9/2021 | |
3.1.11 | 3,464,249 | 1/12/2021 | |
3.1.10 | 5,628,342 | 11/9/2020 | |
3.1.9 | 6,174,468 | 10/13/2020 | |
3.1.8 | 10,545,752 | 9/8/2020 | |
3.1.7 | 4,704,346 | 8/11/2020 | |
3.1.6 | 5,537,822 | 7/14/2020 | |
3.1.5 | 7,884,677 | 6/9/2020 | |
3.1.4 | 7,191,425 | 5/12/2020 | |
3.1.3 | 9,517,719 | 3/24/2020 | |
3.1.2 | 7,115,633 | 2/18/2020 | |
3.1.1 | 9,479,351 | 1/14/2020 | |
3.1.0 | 7,253,059 | 12/3/2019 | |
3.1.0-preview3.19555.2 | 13,634 | 11/13/2019 | |
3.1.0-preview2.19528.8 | 3,387 | 11/1/2019 | |
3.1.0-preview1.19508.20 | 7,371 | 10/15/2019 | |
3.0.3 | 675,415 | 2/18/2020 | |
3.0.2 | 287,242 | 1/14/2020 | |
3.0.0 | 39,554,669 | 9/23/2019 | |
3.0.0-rc1.19457.4 | 25,001 | 9/16/2019 | |
3.0.0-preview9.19424.4 | 148,928 | 9/4/2019 | |
3.0.0-preview8.19405.7 | 27,877 | 8/13/2019 | |
3.0.0-preview7.19365.7 | 40,126 | 7/23/2019 | |
3.0.0-preview6.19307.2 | 36,621 | 6/12/2019 | |
3.0.0-preview5-19227-01 | 24,078 | 5/6/2019 | |
3.0.0-preview4-19216-03 | 7,004 | 4/18/2019 | |
3.0.0-preview3-19153-02 | 7,750 | 3/6/2019 | |
3.0.0-preview-19075-0444 | 12,320 | 1/29/2019 | |
2.2.0 | 28,594,751 | 12/3/2018 | |
2.2.0-preview3-35497 | 71,498 | 10/17/2018 | |
2.2.0-preview2-35157 | 37,103 | 9/12/2018 | |
2.2.0-preview1-35029 | 8,932 | 8/22/2018 | |
2.1.30 | 1,008,734 | 8/19/2021 | |
2.1.2 | 17,497,202 | 8/21/2018 | |
2.1.1 | 11,870,943 | 6/18/2018 | |
2.1.0 | 15,038,152 | 5/29/2018 | |
2.1.0-rc1-final | 40,956 | 5/6/2018 | |
2.1.0-preview2-final | 38,762 | 4/10/2018 | |
2.1.0-preview1-final | 53,801 | 2/26/2018 | |
2.0.4 | 4,562,119 | 5/7/2018 | |
2.0.3 | 4,179,258 | 3/13/2018 | |
2.0.1 | 7,476,753 | 11/14/2017 | |
2.0.0 | 12,146,275 | 8/11/2017 | |
2.0.0-preview2-final | 55,930 | 6/27/2017 | |
2.0.0-preview1-final | 17,907 | 5/10/2017 | |
1.1.3 | 475,687 | 9/20/2017 | |
1.1.2 | 1,253,786 | 5/9/2017 | |
1.1.1 | 474,353 | 3/6/2017 | |
1.1.0 | 397,024 | 11/16/2016 | |
1.1.0-preview1-final | 6,541 | 10/24/2016 | |
1.0.5 | 12,584 | 11/14/2017 | |
1.0.4 | 6,575 | 9/20/2017 | |
1.0.3 | 18,357 | 5/9/2017 | |
1.0.2 | 116,069 | 3/6/2017 | |
1.0.1 | 21,796 | 12/12/2016 | |
1.0.0 | 731,957 | 6/27/2016 | |
1.0.0-rc2-final | 19,543 | 5/16/2016 |