Microsoft.AspNetCore.Authentication.JwtBearer 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.

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

Packages Downloads
SanedBuildingBlocks
This package built for OIG-Saned
3,442
SanedBuildingBlocks
This package built for OIG-Saned
2,443
SanedBuildingBlocks
This package built for OIG-Saned
916
SanedBuildingBlocks
This package built for OIG-Saned
838
SanedBuildingBlocks
This package built for OIG-Saned
764
SanedBuildingBlocks
This package built for OIG-Saned
652
SanedBuildingBlocks
This package built for OIG-Saned
460
SanedBuildingBlocks
This package built for OIG-Saned
428
SanedBuildingBlocks
This package built for OIG-Saned
281
SanedBuildingBlocks
This package built for OIG-Saned
273
SanedBuildingBlocks
This package built for OIG-Saned
236
SanedBuildingBlocks
This package built for OIG-Saned
233
SanedBuildingBlocks
This package built for OIG-Saned
196
SanedBuildingBlocks
This package built for OIG-Saned
191
SanedBuildingBlocks
This package built for OIG-Saned
188
SanedBuildingBlocks
This package built for OIG-Saned
186
SanedBuildingBlocks
This package built for OIG-Saned
172
SanedBuildingBlocks
This package built for OIG-Saned
150
SanedBuildingBlocks
This package built for OIG-Saned
131
SanedBuildingBlocks
This package built for OIG-Saned
126

Version Downloads Last updated
9.0.0 19 12/01/2024
8.0.13 17 02/18/2025
8.0.12 17 02/18/2025
8.0.11 18 12/01/2024
8.0.10 17 02/18/2025
8.0.8 18 10/02/2024
8.0.3 17 03/16/2024
8.0.0 17 02/18/2025
7.0.20 17 02/18/2025
7.0.19 18 02/18/2025
7.0.18 17 02/18/2025
7.0.17 17 02/18/2025
7.0.16 17 02/18/2025
7.0.15 18 02/18/2025
7.0.14 18 12/31/2023
7.0.13 17 02/18/2025
7.0.12 17 02/18/2025
7.0.11 18 09/22/2023
7.0.10 18 09/29/2023
7.0.8 17 06/22/2023
7.0.7 16 02/18/2025
7.0.4 17 08/26/2023
7.0.1 18 10/07/2023
7.0.0 18 06/26/2023
6.0.36 17 02/18/2025
6.0.35 17 02/18/2025
6.0.33 17 02/18/2025
6.0.32 17 02/18/2025
6.0.31 17 02/18/2025
6.0.30 17 02/18/2025
6.0.29 17 02/18/2025
6.0.28 17 02/18/2025
6.0.27 17 02/18/2025
6.0.26 17 02/18/2025
6.0.25 17 02/18/2025
6.0.24 18 02/18/2025
6.0.23 18 02/18/2025
6.0.22 17 02/18/2025
6.0.21 17 02/18/2025
6.0.20 17 02/18/2025
6.0.19 17 02/18/2025
6.0.18 17 02/18/2025
6.0.16 17 02/18/2025
6.0.15 17 02/18/2025
6.0.14 18 02/18/2025
6.0.13 17 02/18/2025
6.0.12 17 02/18/2025
6.0.11 17 02/18/2025
6.0.10 18 09/05/2023
6.0.7 17 06/19/2023
6.0.6 17 02/18/2025
6.0.0 19 06/19/2023
5.0.17 17 10/02/2023
5.0.16 17 02/18/2025
5.0.15 17 02/18/2025
5.0.14 17 02/18/2025
5.0.13 17 02/18/2025
5.0.12 17 02/18/2025
5.0.11 18 02/18/2025
5.0.10 18 06/16/2023
5.0.5 17 02/18/2025
5.0.0 18 02/18/2025
3.1.32 17 02/18/2025
3.1.31 17 02/18/2025
3.1.30 17 02/18/2025
3.1.29 17 02/18/2025
3.1.28 17 02/18/2025
3.1.27 17 02/18/2025
3.1.26 17 02/18/2025
3.1.25 17 02/18/2025
3.1.24 17 02/18/2025
3.1.23 17 02/18/2025
3.1.22 17 02/18/2025
3.1.21 17 02/18/2025
3.1.20 17 02/18/2025
3.1.19 17 02/18/2025
3.1.18 17 02/18/2025
3.1.17 17 02/18/2025
3.1.16 17 02/18/2025
3.1.15 17 02/18/2025
3.1.14 17 02/18/2025
3.1.13 17 02/18/2025
3.1.12 17 02/18/2025
3.1.11 17 02/18/2025
3.1.10 17 02/18/2025
3.1.5 17 08/16/2023
3.1.3 17 02/18/2025
3.1.1 17 02/18/2025
3.0.3 15 02/18/2025
3.0.0 17 02/18/2025
2.2.0 17 02/18/2025
2.2.0-preview2-35157 18 02/18/2025
2.2.0-preview1-35029 18 02/18/2025
2.1.30 17 02/18/2025
2.1.2 17 02/18/2025
2.1.1 18 01/14/2024
2.1.0-rc1-final 17 02/18/2025
2.1.0-preview2-final 17 02/18/2025
2.1.0-preview1-final 17 02/18/2025
2.0.0 18 02/18/2025
2.0.0-preview2-final 17 02/18/2025
2.0.0-preview1-final 17 02/18/2025
1.1.3 17 02/18/2025
1.1.2 15 02/18/2025
1.1.1 18 02/18/2025
1.1.0 17 02/18/2025
1.1.0-preview1-final 18 02/18/2025
1.0.1 18 02/18/2025
1.0.0 17 02/18/2025
1.0.0-rc2-final 17 02/18/2025