Skip to content

A simple implementation for securing the API by PASETO public access tokens for ASP.NET Core

License

Notifications You must be signed in to change notification settings

blazkaro/PasetoBearer.Authentication

Repository files navigation

PasetoBearer.Authentication

A simple implementation for securing the API by public PASETO access tokens.

Usage

services.AddAuthentication()
    .AddPasetoBearer(cfg =>
    {
    });

app.UseAuthentication();
app.UseAuthorization();

And then you can use PasetoBearer authentication scheme in controller with [AuthorizeAttribute] like this:

[HttpGet]
[Authorize(AuthenticationSchemes = PasetoBearerDefaults.AuthenticationScheme)]
public IActionResult SomeMethod()
{
    return Ok();
}

About

A simple implementation for securing the API by PASETO public access tokens for ASP.NET Core

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages