Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

TechNobre/PowerUtils.AspNetCore.Authentication.JwtBearer

Repository files navigation

PowerUtils.AspNetCore.Authentication.JwtBearer

⚠️ DEPRECATED

This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary. The package will be completely removed after 2024/01/08.

Logo

Utils, helpers, extensions and attributes to work with JWT authentication

NuGet Nuget License: MIT

Support to

  • .NET 7.0
  • .NET 6.0
  • .NET 5.0
  • .NET 3.1

Dependencies

  • Microsoft.AspNetCore.Authentication.JwtBearer NuGet

How to use

Install NuGet package

This package is available through Nuget Packages: https://www.nuget.org/packages/PowerUtils.AspNetCore.Authentication.JwtBearer

Nuget

Install-Package PowerUtils.AspNetCore.Authentication.JwtBearer

.NET CLI

dotnet add package PowerUtils.AspNetCore.Authentication.JwtBearer

Attributes

JWTAuthentication;

Attribute to limit access to a controller or action with a JWT token

[JWTAuthentication]
[ApiController]
public class TestController : ControllerBase
{
    [HttpGet]
    public async Task<IActionResult> Get()
    {
        return this.Ok();
    }
}
[ApiController]
public class TestController : ControllerBase
{
    [JWTAuthentication]
    [HttpGet]
    public async Task<IActionResult> Get()
    {
        return this.Ok();
    }
}

Contribution

If you have any questions, comments, or suggestions, please open an issue or create a pull request