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.
Utils, helpers, extensions and attributes to work with JWT authentication
- .NET 7.0
- .NET 6.0
- .NET 5.0
- .NET 3.1
- Microsoft.AspNetCore.Authentication.JwtBearer NuGet
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
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();
}
}
If you have any questions, comments, or suggestions, please open an issue or create a pull request