Microsoft.AspNetCore.Authentication.JwtBearer 9.0.1

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.

Showing the top 20 packages that depend on Microsoft.AspNetCore.Authentication.JwtBearer.

Packages Downloads
MT.PACKAGE.UTILITY
妙探科技nuget工具包
263
MT.PACKAGE.UTILITY
妙探科技nuget工具包 1、添加日期转财务报表报告期DateTime扩展方法
104
Volo.Abp.AspNetCore.Authentication.JwtBearer
Package Description
38
Volo.Abp.AspNetCore.Authentication.JwtBearer
Package Description
37
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.
31
Volo.Abp.AspNetCore.Authentication.JwtBearer
Package Description
30
Volo.Abp.AspNetCore.Authentication.JwtBearer
Package Description
28
Volo.Abp.AspNetCore.Authentication.JwtBearer
Package Description
27
Volo.Abp.AspNetCore.Authentication.JwtBearer
Package Description
26
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.
26
Volo.Abp.AspNetCore.Authentication.JwtBearer
Package Description
25
Microsoft.AspNetCore.All
Microsoft.AspNetCore.All
25

Version Downloads Last updated
9.0.1 5 01/19/2025
9.0.0 12 11/13/2024
9.0.0-rc.2.24474.3 8 10/23/2024
9.0.0-rc.1.24452.1 14 09/11/2024
9.0.0-preview.7.24406.2 14 08/16/2024
9.0.0-preview.6.24328.4 13 07/13/2024
9.0.0-preview.5.24306.11 16 06/14/2024
9.0.0-preview.4.24267.6 17 05/26/2024
9.0.0-preview.3.24172.13 18 04/14/2024
9.0.0-preview.2.24128.4 15 03/12/2024
9.0.0-preview.1.24081.5 16 02/26/2024
8.0.12 4 01/21/2025
8.0.11 8 11/13/2024
8.0.10 12 10/10/2024
8.0.8 15 08/16/2024
8.0.7 18 07/12/2024
8.0.6 16 06/03/2024
8.0.5 19 05/29/2024
8.0.4 21 04/10/2024
8.0.3 19 03/12/2024
8.0.2 312 02/20/2024
8.0.1 24 01/17/2024
8.0.0 802 11/24/2023
8.0.0-rc.2.23480.2 18 10/11/2023
8.0.0-rc.1.23421.29 16 09/27/2023
8.0.0-preview.7.23375.9 24 08/14/2023
8.0.0-preview.6.23329.11 21 08/18/2023
8.0.0-preview.5.23302.2 17 09/29/2023
8.0.0-preview.4.23260.4 26 06/09/2023
8.0.0-preview.3.23177.8 22 06/20/2023
8.0.0-preview.2.23153.2 24 06/09/2023
8.0.0-preview.1.23112.2 21 06/08/2023
7.0.20 16 06/03/2024
7.0.19 16 05/19/2024
7.0.18 16 04/10/2024
7.0.17 18 03/12/2024
7.0.16 18 02/27/2024
7.0.15 20 01/17/2024
7.0.14 19 02/15/2024
7.0.13 23 01/09/2024
7.0.12 19 12/18/2023
7.0.11 21 10/25/2023
7.0.10 23 08/16/2023
7.0.9 18 09/29/2023
7.0.8 21 09/29/2023
7.0.7 44 06/16/2023
7.0.5 19 04/26/2023
7.0.4 16 09/29/2023
7.0.3 24 02/28/2023
7.0.2 23 07/05/2023
7.0.1 21 09/30/2023
7.0.0 20 06/16/2023
7.0.0-rc.2.22476.2 21 06/07/2023
7.0.0-rc.1.22427.2 19 09/29/2023
7.0.0-preview.7.22376.6 20 07/06/2023
7.0.0-preview.6.22330.3 19 10/18/2023
7.0.0-preview.5.22303.8 19 09/30/2023
7.0.0-preview.4.22251.1 18 11/26/2023
7.0.0-preview.3.22178.4 23 10/14/2023
7.0.0-preview.2.22153.2 20 09/29/2023
7.0.0-preview.1.22109.13 25 10/10/2023
6.0.36 11 11/13/2024
6.0.35 10 10/23/2024
6.0.33 13 08/16/2024
6.0.32 17 07/13/2024
6.0.31 16 06/03/2024
6.0.30 18 05/20/2024
6.0.29 22 04/10/2024
6.0.28 21 03/12/2024
6.0.27 20 02/26/2024
6.0.26 17 03/12/2024
6.0.25 16 01/17/2024
6.0.24 24 03/11/2024
6.0.23 21 01/10/2024
6.0.22 23 09/29/2023
6.0.21 19 08/16/2023
6.0.20 19 01/10/2024
6.0.19 20 12/29/2023
6.0.18 21 06/16/2023
6.0.16 913 04/13/2023
6.0.15 22 06/19/2023
6.0.14 24 03/08/2023
6.0.13 23 10/05/2023
6.0.12 24 07/05/2023
6.0.11 18 06/07/2023
6.0.10 25 06/19/2023
6.0.9 20 10/11/2023
6.0.8 17 12/12/2023
6.0.7 18 10/01/2023
6.0.6 308 06/22/2022
6.0.5 22 08/16/2023
6.0.4 26 08/14/2023
6.0.3 23 06/08/2023
6.0.2 29 10/10/2023
6.0.1 18 09/30/2023
6.0.0 1,636 11/18/2021
6.0.0-rc.2.21480.10 16 09/28/2023
6.0.0-rc.1.21452.15 20 06/09/2023
6.0.0-preview.7.21378.6 24 06/07/2023
6.0.0-preview.6.21355.2 21 06/20/2023
6.0.0-preview.5.21301.17 20 10/18/2023
6.0.0-preview.4.21253.5 25 06/19/2023
6.0.0-preview.3.21201.13 23 08/20/2023
6.0.0-preview.2.21154.6 20 08/18/2023
6.0.0-preview.1.21103.6 24 09/30/2023
5.0.17 20 07/04/2023
5.0.16 21 07/22/2023
5.0.15 18 06/09/2023
5.0.14 21 07/26/2023
5.0.13 19 10/08/2023
5.0.12 16 10/01/2023
5.0.11 22 09/29/2023
5.0.10 22 10/05/2023
5.0.9 21 09/29/2023
5.0.8 22 10/02/2023
5.0.7 18 12/11/2023
5.0.6 20 12/26/2023
5.0.5 18 12/10/2023
5.0.4 22 10/05/2023
5.0.3 23 10/12/2023
5.0.2 19 12/03/2021
5.0.1 21 09/30/2023
5.0.0 760 12/16/2020
5.0.0-rc.2.20475.17 15 09/30/2023
5.0.0-rc.1.20451.17 19 10/02/2023
5.0.0-preview.8.20414.8 20 10/06/2023
5.0.0-preview.7.20365.19 20 10/17/2023
5.0.0-preview.6.20312.15 17 10/02/2023
5.0.0-preview.5.20279.2 25 10/02/2023
5.0.0-preview.4.20257.10 18 12/02/2023
5.0.0-preview.3.20215.14 22 09/29/2023
5.0.0-preview.2.20167.3 18 10/02/2023
5.0.0-preview.1.20124.5 17 11/26/2023
3.1.32 18 09/29/2023
3.1.31 18 09/30/2023
3.1.30 18 10/04/2023
3.1.29 18 01/06/2024
3.1.28 19 09/29/2023
3.1.27 20 11/02/2023
3.1.26 17 01/09/2024
3.1.25 19 10/02/2023
3.1.24 19 10/12/2023
3.1.23 18 12/01/2023
3.1.22 20 09/29/2023
3.1.21 19 09/29/2023
3.1.20 16 11/04/2023
3.1.19 19 09/30/2023
3.1.18 19 10/03/2023
3.1.17 20 09/30/2023
3.1.16 13 02/24/2024
3.1.15 17 02/22/2024
3.1.14 21 10/02/2023
3.1.13 21 09/30/2023
3.1.12 17 10/08/2023
3.1.11 17 10/08/2023
3.1.10 21 09/29/2023
3.1.9 22 09/21/2023
3.1.8 22 09/29/2023
3.1.7 22 10/05/2023
3.1.6 19 09/29/2023
3.1.5 18 10/07/2023
3.1.4 15 10/02/2023
3.1.3 20 11/26/2023
3.1.2 22 10/09/2023
3.1.1 21 12/07/2023
3.1.0 22 09/30/2023
3.1.0-preview3.19555.2 17 10/05/2023
3.1.0-preview2.19528.8 21 11/26/2023
3.1.0-preview1.19508.20 20 10/08/2023
3.0.3 23 11/06/2023
3.0.2 21 09/26/2023
3.0.0 34 04/14/2021
3.0.0-rc1.19457.4 17 11/26/2023
3.0.0-preview9.19424.4 18 10/02/2023
3.0.0-preview8.19405.7 18 11/26/2023
3.0.0-preview7.19365.7 20 11/26/2023
3.0.0-preview6.19307.2 21 10/13/2023
3.0.0-preview5-19227-01 22 10/02/2023
3.0.0-preview4-19216-03 23 09/28/2023
3.0.0-preview3-19153-02 20 10/08/2023
3.0.0-preview-19075-0444 23 09/30/2023
2.3.0 5 01/19/2025
2.2.0 23 10/27/2023
2.2.0-preview3-35497 21 10/03/2023
2.2.0-preview2-35157 21 09/29/2023
2.2.0-preview1-35029 20 09/29/2023
2.1.30 20 02/23/2024
2.1.2 20 09/29/2023
2.1.1 19 09/30/2023
2.1.0 24 09/02/2023
2.1.0-rc1-final 23 09/29/2023
2.1.0-preview2-final 22 09/30/2023
2.1.0-preview1-final 23 10/22/2023
2.0.4 21 10/02/2023
2.0.3 22 11/06/2023
2.0.1 26 09/29/2023
2.0.0 21 09/29/2023
2.0.0-preview2-final 26 10/22/2023
2.0.0-preview1-final 19 09/28/2023
1.1.3 21 10/08/2023
1.1.2 20 10/05/2023
1.1.1 21 09/29/2023
1.1.0 25 10/01/2023
1.1.0-preview1-final 20 10/22/2023
1.0.5 26 10/11/2023
1.0.4 22 09/30/2023
1.0.3 20 10/11/2023
1.0.2 23 09/30/2023
1.0.1 22 09/29/2023
1.0.0 23 10/02/2023
1.0.0-rc2-final 24 10/22/2023