Microsoft.AspNetCore.Authentication.JwtBearer 10.0.0-preview.4.25258.110

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
IdentityServer4.AccessTokenValidation
ASP.NET Core authentication handler to validate JWT and reference tokens from IdentityServer4
28
IdentityServer4.AccessTokenValidation
ASP.NET Core middleware to validate JWT and reference tokens from IdentityServer4
23
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 at: https://github.com/aspnet/AADIntegration/tree/1c7e5d489d03b6e11fb529661062d1b4eba62e3a
23
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 at: https://github.com/aspnet/AADIntegration/tree/b252a87119d5979b49cec1a57dbbb0e0f356f79a
24
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/aspnet/AspNetCore/tree/331b52b370cd4e7fe2919d4d4cda27412e2ab1cc
26
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/aspnet/AspNetCore/tree/440dadc05b2bed38e6a726c2492db90e77d43c62
23
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/aspnet/AspNetCore/tree/5502cf46706a25c39ce78a57b9191714c0eb40c2
23
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/aspnet/AspNetCore/tree/fbe05294ac5c88be848b4d57d60cb2657874da9b
23
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/5a007deadbb2636caff4656333cafc818b6b2ef6
23
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/98a853b20131fd59b37076dd3699d8c7f62b24cb
23
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
23
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/b92c9f50f0333ea661785ba849f303cde6a93844
25
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/c0ae1d179dba6f3acd0e55be55718c97c9028698
23
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/ecdcc752d4639061c2c49727ee77a1039bbbca22
22
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
31
Microsoft.Identity.Web
This package enables ASP.NET Core Web apps and Web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
22
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
25
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
26
Volo.Abp.AspNetCore.Authentication.JwtBearer
Package Description
23
Volo.Abp.AspNetCore.Authentication.JwtBearer
Package Description
29

Version Downloads Last updated
10.0.0-preview.4.25258.110 2 05/15/2025
10.0.0-preview.3.25172.1 6 04/22/2025
10.0.0-preview.2.25164.1 11 03/22/2025
10.0.0-preview.1.25120.3 10 03/09/2025
9.0.5 1 05/16/2025
9.0.4 5 04/19/2025
9.0.3 11 03/18/2025
9.0.2 12 02/21/2025
9.0.1 15 01/17/2025
9.0.0 15 11/14/2024
9.0.0-rc.2.24474.3 11 11/28/2024
9.0.0-rc.1.24452.1 14 12/03/2024
9.0.0-preview.7.24406.2 15 11/23/2024
9.0.0-preview.6.24328.4 11 11/23/2024
9.0.0-preview.5.24306.11 13 12/02/2024
9.0.0-preview.4.24267.6 20 05/25/2024
9.0.0-preview.3.24172.13 19 05/10/2024
9.0.0-preview.2.24128.4 18 04/23/2024
9.0.0-preview.1.24081.5 21 04/24/2024
8.0.16 2 05/16/2025
8.0.15 8 04/19/2025
8.0.14 11 03/18/2025
8.0.13 11 02/18/2025
8.0.12 13 01/17/2025
8.0.11 12 11/14/2024
8.0.10 16 11/04/2024
8.0.8 11 12/02/2024
8.0.7 12 11/29/2024
8.0.6 14 11/29/2024
8.0.5 14 05/31/2024
8.0.4 19 05/03/2024
8.0.3 13 05/10/2024
8.0.2 16 04/29/2024
8.0.1 17 05/31/2024
8.0.0 20 12/18/2023
8.0.0-rc.2.23480.2 19 05/07/2024
8.0.0-rc.1.23421.29 17 05/16/2024
8.0.0-preview.7.23375.9 12 05/31/2024
8.0.0-preview.6.23329.11 15 05/31/2024
8.0.0-preview.5.23302.2 15 05/31/2024
8.0.0-preview.4.23260.4 15 05/10/2024
8.0.0-preview.3.23177.8 15 04/23/2023
8.0.0-preview.2.23153.2 17 05/31/2024
8.0.0-preview.1.23112.2 13 04/22/2024
7.0.20 13 11/18/2024
7.0.19 20 05/14/2024
7.0.18 20 04/24/2024
7.0.17 16 05/10/2024
7.0.16 15 05/05/2024
7.0.15 16 05/06/2024
7.0.14 20 05/10/2024
7.0.13 19 05/31/2024
7.0.12 19 05/08/2024
7.0.11 21 05/02/2024
7.0.10 19 05/10/2024
7.0.9 16 05/31/2024
7.0.8 16 05/20/2024
7.0.7 17 12/18/2023
7.0.5 16 05/31/2024
7.0.4 14 05/06/2024
7.0.3 16 07/13/2023
7.0.2 15 05/07/2024
7.0.1 20 04/26/2024
7.0.0 18 05/31/2024
7.0.0-rc.2.22476.2 16 05/31/2024
7.0.0-rc.1.22427.2 14 05/31/2024
7.0.0-preview.7.22376.6 13 11/23/2024
7.0.0-preview.6.22330.3 15 05/31/2024
7.0.0-preview.5.22303.8 17 05/31/2024
7.0.0-preview.4.22251.1 18 05/25/2024
6.0.36 15 11/18/2024
6.0.35 17 11/14/2024
6.0.33 12 12/01/2024
6.0.32 13 12/05/2024
6.0.31 12 12/03/2024
6.0.30 17 05/14/2024
6.0.29 18 05/10/2024
6.0.28 16 05/07/2024
6.0.27 16 05/10/2024
6.0.26 14 05/31/2024
6.0.25 16 05/10/2024
6.0.24 16 05/01/2024
6.0.23 22 05/03/2024
6.0.22 18 05/02/2024
6.0.21 19 05/10/2024
6.0.20 14 12/02/2024
6.0.19 17 05/16/2024
6.0.18 15 04/24/2024
6.0.16 15 05/01/2024
6.0.15 12 12/03/2024
6.0.14 18 05/31/2024
6.0.13 19 05/03/2024
6.0.12 30 05/07/2023
6.0.11 15 05/05/2024
6.0.10 16 05/01/2024
6.0.9 18 05/06/2024
6.0.8 15 04/26/2024
6.0.7 17 05/31/2024
6.0.6 24 03/22/2023
6.0.5 15 05/31/2024
6.0.0-preview.6.21355.2 16 05/25/2024
5.0.17 17 07/13/2023
5.0.12 20 05/10/2022
5.0.9 13 04/23/2024
5.0.0-rc.1.20451.17 17 05/25/2024
3.1.32 21 04/23/2023
3.1.31 16 05/31/2024
3.1.30 14 10/25/2022
3.1.29 19 04/22/2024
3.1.28 17 05/07/2024
3.1.27 19 05/18/2024
3.1.26 15 04/23/2024
3.1.25 17 05/25/2024
3.1.8 13 05/31/2024
3.1.0 20 05/05/2024
3.0.0 18 02/04/2024
3.0.0-rc1.19457.4 15 05/31/2024
2.3.0 12 01/28/2025
2.1.2 23 05/10/2022
2.0.0-preview2-final 17 05/10/2024
1.0.5 13 05/14/2024