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 |
---|---|
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 (423)
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 | 55,213 | 11/12/2024 | |
9.0.0-rc.2.24474.3 | 44,711 | 10/8/2024 | |
9.0.0-rc.1.24452.1 | 32,909 | 9/10/2024 | |
9.0.0-preview.7.24406.2 | 8,190 | 8/13/2024 | |
9.0.0-preview.6.24328.4 | 26,425 | 7/9/2024 | |
9.0.0-preview.5.24306.11 | 5,692 | 6/11/2024 | |
9.0.0-preview.4.24267.6 | 11,483 | 5/21/2024 | |
9.0.0-preview.3.24172.13 | 79,589 | 4/11/2024 | |
9.0.0-preview.2.24128.4 | 25,662 | 3/12/2024 | |
9.0.0-preview.1.24081.5 | 26,072 | 2/13/2024 | |
8.0.11 | 105,295 | 11/12/2024 | |
8.0.10 | 3,025,843 | 10/8/2024 | |
8.0.8 | 6,923,884 | 8/13/2024 | |
8.0.7 | 5,652,285 | 7/9/2024 | |
8.0.6 | 7,111,793 | 5/28/2024 | |
8.0.5 | 2,665,360 | 5/14/2024 | |
8.0.4 | 6,688,487 | 4/9/2024 | |
8.0.3 | 4,862,684 | 3/12/2024 | |
8.0.2 | 5,721,551 | 2/13/2024 | |
8.0.1 | 7,004,768 | 1/9/2024 | |
8.0.0 | 20,925,146 | 11/14/2023 | |
8.0.0-rc.2.23480.2 | 399,030 | 10/10/2023 | |
8.0.0-rc.1.23421.29 | 92,845 | 9/12/2023 | |
8.0.0-preview.7.23375.9 | 174,415 | 8/8/2023 | |
8.0.0-preview.6.23329.11 | 61,885 | 7/11/2023 | |
8.0.0-preview.5.23302.2 | 11,269 | 6/13/2023 | |
8.0.0-preview.4.23260.4 | 10,273 | 5/16/2023 | |
8.0.0-preview.3.23177.8 | 16,552 | 4/11/2023 | |
8.0.0-preview.2.23153.2 | 7,896 | 3/14/2023 | |
8.0.0-preview.1.23112.2 | 59,221 | 2/21/2023 | |
7.0.20 | 674,924 | 5/28/2024 | |
7.0.19 | 103,014 | 5/14/2024 | |
7.0.18 | 329,511 | 4/9/2024 | |
7.0.17 | 354,640 | 3/12/2024 | |
7.0.16 | 576,090 | 2/13/2024 | |
7.0.15 | 1,013,280 | 1/9/2024 | |
7.0.14 | 2,055,453 | 11/14/2023 | |
7.0.13 | 2,380,033 | 10/24/2023 | |
7.0.12 | 1,783,171 | 10/10/2023 | |
7.0.11 | 2,603,019 | 9/12/2023 | |
7.0.10 | 3,651,120 | 8/8/2023 | |
7.0.9 | 2,671,372 | 7/11/2023 | |
7.0.8 | 2,252,399 | 6/22/2023 | |
7.0.7 | 1,186,083 | 6/13/2023 | |
7.0.5 | 6,953,988 | 4/11/2023 | |
7.0.4 | 3,450,148 | 3/14/2023 | |
7.0.3 | 3,313,643 | 2/14/2023 | |
7.0.2 | 4,146,663 | 1/10/2023 | |
7.0.1 | 8,732,616 | 12/13/2022 | |
7.0.0 | 5,065,406 | 11/7/2022 | |
7.0.0-rc.2.22476.2 | 84,142 | 10/11/2022 | |
7.0.0-rc.1.22427.2 | 23,510 | 9/14/2022 | |
7.0.0-preview.7.22376.6 | 23,168 | 8/9/2022 | |
7.0.0-preview.6.22330.3 | 218,192 | 7/12/2022 | |
7.0.0-preview.5.22303.8 | 6,103 | 6/14/2022 | |
7.0.0-preview.4.22251.1 | 10,361 | 5/10/2022 | |
7.0.0-preview.3.22178.4 | 4,358 | 4/13/2022 | |
7.0.0-preview.2.22153.2 | 3,870 | 3/14/2022 | |
7.0.0-preview.1.22109.13 | 3,312 | 2/17/2022 | |
6.0.36 | 14,256 | 11/12/2024 | |
6.0.35 | 158,325 | 10/8/2024 | |
6.0.33 | 584,080 | 8/13/2024 | |
6.0.32 | 521,001 | 7/9/2024 | |
6.0.31 | 705,636 | 5/28/2024 | |
6.0.30 | 349,903 | 5/14/2024 | |
6.0.29 | 1,111,392 | 4/9/2024 | |
6.0.28 | 1,009,136 | 3/12/2024 | |
6.0.27 | 1,289,979 | 2/13/2024 | |
6.0.26 | 2,465,718 | 1/9/2024 | |
6.0.25 | 3,264,991 | 11/14/2023 | |
6.0.24 | 1,976,457 | 10/24/2023 | |
6.0.23 | 980,391 | 10/10/2023 | |
6.0.22 | 1,829,058 | 9/12/2023 | |
6.0.21 | 2,609,962 | 8/8/2023 | |
6.0.20 | 2,469,760 | 7/11/2023 | |
6.0.19 | 1,627,740 | 6/22/2023 | |
6.0.18 | 824,406 | 6/13/2023 | |
6.0.16 | 6,724,946 | 4/11/2023 | |
6.0.15 | 4,061,909 | 3/14/2023 | |
6.0.14 | 4,419,742 | 2/14/2023 | |
6.0.13 | 6,997,600 | 1/10/2023 | |
6.0.12 | 10,392,971 | 12/13/2022 | |
6.0.11 | 7,434,538 | 11/7/2022 | |
6.0.10 | 11,471,710 | 10/11/2022 | |
6.0.9 | 8,713,221 | 9/13/2022 | |
6.0.8 | 10,897,251 | 8/9/2022 | |
6.0.7 | 8,800,141 | 7/12/2022 | |
6.0.6 | 7,129,346 | 6/14/2022 | |
6.0.5 | 10,127,511 | 5/10/2022 | |
6.0.4 | 7,988,533 | 4/11/2022 | |
6.0.3 | 9,391,601 | 3/8/2022 | |
6.0.2 | 7,328,055 | 2/8/2022 | |
6.0.1 | 12,539,232 | 12/14/2021 | |
6.0.0 | 12,480,227 | 11/8/2021 | |
6.0.0-rc.2.21480.10 | 74,795 | 10/12/2021 | |
6.0.0-rc.1.21452.15 | 59,437 | 9/14/2021 | |
6.0.0-preview.7.21378.6 | 65,222 | 8/10/2021 | |
6.0.0-preview.6.21355.2 | 19,056 | 7/14/2021 | |
6.0.0-preview.5.21301.17 | 11,523 | 6/15/2021 | |
6.0.0-preview.4.21253.5 | 9,810 | 5/24/2021 | |
6.0.0-preview.3.21201.13 | 13,514 | 4/8/2021 | |
6.0.0-preview.2.21154.6 | 3,890 | 3/11/2021 | |
6.0.0-preview.1.21103.6 | 6,342 | 2/12/2021 | |
5.0.17 | 2,608,043 | 5/10/2022 | |
5.0.16 | 641,724 | 4/11/2022 | |
5.0.15 | 999,904 | 3/8/2022 | |
5.0.14 | 939,399 | 2/8/2022 | |
5.0.13 | 2,498,604 | 12/14/2021 | |
5.0.12 | 20,166,058 | 11/7/2021 | |
5.0.11 | 3,845,467 | 10/12/2021 | |
5.0.10 | 3,878,635 | 9/14/2021 | |
5.0.9 | 7,345,888 | 8/10/2021 | |
5.0.8 | 2,867,373 | 7/13/2021 | |
5.0.7 | 4,118,111 | 6/8/2021 | |
5.0.6 | 2,928,135 | 5/11/2021 | |
5.0.5 | 4,141,964 | 4/6/2021 | |
5.0.4 | 2,950,204 | 3/9/2021 | |
5.0.3 | 3,126,182 | 2/9/2021 | |
5.0.2 | 2,797,673 | 1/12/2021 | |
5.0.1 | 3,153,090 | 12/8/2020 | |
5.0.0 | 10,783,132 | 11/9/2020 | |
5.0.0-rc.2.20475.17 | 106,007 | 10/13/2020 | |
5.0.0-rc.1.20451.17 | 270,361 | 9/14/2020 | |
5.0.0-preview.8.20414.8 | 1,174,582 | 8/25/2020 | |
5.0.0-preview.7.20365.19 | 16,597 | 7/21/2020 | |
5.0.0-preview.6.20312.15 | 20,495 | 6/25/2020 | |
5.0.0-preview.5.20279.2 | 3,437 | 6/10/2020 | |
5.0.0-preview.4.20257.10 | 4,282 | 5/18/2020 | |
5.0.0-preview.3.20215.14 | 4,388 | 4/23/2020 | |
5.0.0-preview.2.20167.3 | 3,458 | 4/2/2020 | |
5.0.0-preview.1.20124.5 | 5,480 | 3/16/2020 | |
3.1.32 | 2,026,273 | 12/13/2022 | |
3.1.31 | 257,663 | 11/8/2022 | |
3.1.30 | 204,842 | 10/11/2022 | |
3.1.29 | 246,546 | 9/13/2022 | |
3.1.28 | 2,010,654 | 8/9/2022 | |
3.1.27 | 352,813 | 7/12/2022 | |
3.1.26 | 340,810 | 6/14/2022 | |
3.1.25 | 629,792 | 5/10/2022 | |
3.1.24 | 453,141 | 4/11/2022 | |
3.1.23 | 1,914,721 | 3/8/2022 | |
3.1.22 | 3,030,339 | 12/14/2021 | |
3.1.21 | 2,193,504 | 11/7/2021 | |
3.1.20 | 976,324 | 10/11/2021 | |
3.1.19 | 1,216,622 | 9/14/2021 | |
3.1.18 | 7,722,322 | 8/10/2021 | |
3.1.17 | 1,087,198 | 7/13/2021 | |
3.1.16 | 2,143,811 | 6/8/2021 | |
3.1.15 | 1,584,159 | 5/11/2021 | |
3.1.14 | 2,023,614 | 4/6/2021 | |
3.1.13 | 2,333,788 | 3/9/2021 | |
3.1.12 | 2,110,425 | 2/9/2021 | |
3.1.11 | 3,452,453 | 1/12/2021 | |
3.1.10 | 5,609,003 | 11/9/2020 | |
3.1.9 | 6,139,131 | 10/13/2020 | |
3.1.8 | 10,499,000 | 9/8/2020 | |
3.1.7 | 4,683,905 | 8/11/2020 | |
3.1.6 | 5,497,474 | 7/14/2020 | |
3.1.5 | 7,852,073 | 6/9/2020 | |
3.1.4 | 7,165,165 | 5/12/2020 | |
3.1.3 | 9,454,260 | 3/24/2020 | |
3.1.2 | 7,079,813 | 2/18/2020 | |
3.1.1 | 9,421,906 | 1/14/2020 | |
3.1.0 | 7,209,527 | 12/3/2019 | |
3.1.0-preview3.19555.2 | 13,573 | 11/13/2019 | |
3.1.0-preview2.19528.8 | 3,365 | 11/1/2019 | |
3.1.0-preview1.19508.20 | 7,337 | 10/15/2019 | |
3.0.3 | 671,019 | 2/18/2020 | |
3.0.2 | 285,783 | 1/14/2020 | |
3.0.0 | 38,851,498 | 9/23/2019 | |
3.0.0-rc1.19457.4 | 24,967 | 9/16/2019 | |
3.0.0-preview9.19424.4 | 147,000 | 9/4/2019 | |
3.0.0-preview8.19405.7 | 27,849 | 8/13/2019 | |
3.0.0-preview7.19365.7 | 40,096 | 7/23/2019 | |
3.0.0-preview6.19307.2 | 36,444 | 6/12/2019 | |
3.0.0-preview5-19227-01 | 24,004 | 5/6/2019 | |
3.0.0-preview4-19216-03 | 6,979 | 4/18/2019 | |
3.0.0-preview3-19153-02 | 7,722 | 3/6/2019 | |
3.0.0-preview-19075-0444 | 12,277 | 1/29/2019 | |
2.2.0 | 28,232,256 | 12/3/2018 | |
2.2.0-preview3-35497 | 71,399 | 10/17/2018 | |
2.2.0-preview2-35157 | 36,005 | 9/12/2018 | |
2.2.0-preview1-35029 | 8,884 | 8/22/2018 | |
2.1.30 | 952,200 | 8/19/2021 | |
2.1.2 | 17,451,566 | 8/21/2018 | |
2.1.1 | 11,603,807 | 6/18/2018 | |
2.1.0 | 14,942,526 | 5/29/2018 | |
2.1.0-rc1-final | 40,917 | 5/6/2018 | |
2.1.0-preview2-final | 38,714 | 4/10/2018 | |
2.1.0-preview1-final | 53,735 | 2/26/2018 | |
2.0.4 | 4,529,914 | 5/7/2018 | |
2.0.3 | 4,159,578 | 3/13/2018 | |
2.0.1 | 7,432,223 | 11/14/2017 | |
2.0.0 | 12,093,881 | 8/11/2017 | |
2.0.0-preview2-final | 55,755 | 6/27/2017 | |
2.0.0-preview1-final | 17,763 | 5/10/2017 | |
1.1.3 | 470,112 | 9/20/2017 | |
1.1.2 | 1,249,457 | 5/9/2017 | |
1.1.1 | 472,289 | 3/6/2017 | |
1.1.0 | 396,283 | 11/16/2016 | |
1.1.0-preview1-final | 6,518 | 10/24/2016 | |
1.0.5 | 12,471 | 11/14/2017 | |
1.0.4 | 6,490 | 9/20/2017 | |
1.0.3 | 18,092 | 5/9/2017 | |
1.0.2 | 115,693 | 3/6/2017 | |
1.0.1 | 21,762 | 12/12/2016 | |
1.0.0 | 715,033 | 6/27/2016 | |
1.0.0-rc2-final | 19,515 | 5/16/2016 |