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 Basic authentication
- .NET 6.0
- .NET 5.0
- .NET 3.1
- Microsoft.AspNetCore.Authorization NuGet
This package is available through Nuget Packages: https://www.nuget.org/packages/PowerUtils.AspNetCore.Authentication.BasicAuth
Nuget
Install-Package PowerUtils.AspNetCore.Authentication.BasicAuth
.NET CLI
dotnet add package PowerUtils.AspNetCore.Authentication.BasicAuth
Attribute to limit access to a controller or action with a basic authentication
[BasicAuthentication]
[ApiController]
public class TestController : ControllerBase
{
[HttpGet]
public async Task<IActionResult> Get()
{
return this.Ok();
}
}
[ApiController]
public class TestController : ControllerBase
{
[BasicAuthentication]
[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