Skip to content
A [RequireClaim()] Authorization Attribute for Asp.Net Core
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

[RequireClaim()] Attribute for AspNetCore

AspNet Core has simpled Attribute-based, declarative authorization for Roles and Policies but not for Claims. This project adds authorization for Claims using the "expected" Attribute-based syntax. The attribute inherits from AuthorizeAttribute and can be applied to Controller or to Action.

    [RequireClaim("AClaimType",Value = "RequiredValue")]
    public IActionResult Action(){}

    public IActionResult Action(){}

#Usage In Startup.cs:

    public void ConfigureServices(IServiceCollection services)
You can’t perform that action at this time.