Brixa.Identity.Authorization 1.0.0

dotnet add package Brixa.Identity.Authorization --version 1.0.0
                    
NuGet\Install-Package Brixa.Identity.Authorization -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Brixa.Identity.Authorization" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Brixa.Identity.Authorization" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Brixa.Identity.Authorization" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Brixa.Identity.Authorization --version 1.0.0
                    
#r "nuget: Brixa.Identity.Authorization, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Brixa.Identity.Authorization@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Brixa.Identity.Authorization&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Brixa.Identity.Authorization&version=1.0.0
                    
Install as a Cake Tool

Brixa.Identity.Authorization

Permission-based authorization for ASP.NET Core services.

Install

dotnet add package Brixa.Identity.Authorization

Setup

builder.Services.AddBrixaPermissionAuthorization();

Protect Endpoints

[RequirePermission("merchant.kyc.approve")]
[HttpPost("{merchantId}/approve")]
public IActionResult Approve(Guid merchantId) => Ok();

Use well-known constants for seed permissions:

[RequirePermission(WellKnownPermissions.MerchantKycApprove)]

Or use plain strings for permissions created at runtime:

[RequirePermission("custom.permission.created.via.api")]

How It Works

  1. Checks JWT claims for the required permission
  2. If not found, checks if user has the SuperAdmin role (configurable bypass)
  3. If not found and IPermissionChecker is registered, falls back to a remote check against the Identity Service
  4. Denies access if all checks fail

Configuration

SuperAdmin Bypass

The role that bypasses all permission checks defaults to "SuperAdmin". Override it:

{
  "BrixaIdentity": {
    "SuperAdminRole": "PlatformAdmin"
  }
}

Permission Caching

Enable caching to avoid repeated remote permission checks:

{
  "BrixaIdentity": {
    "EnablePermissionCaching": true,
    "PermissionCacheDurationSeconds": 300
  }
}

Remote Permission Fallback

If permissions aren't embedded in the JWT (e.g., user has 50+ permissions), the handler falls back to IPermissionChecker. This is automatically registered when you use AddBrixaIdentity().

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Brixa.Identity.Authorization:

Package Downloads
Brixa.Identity.Platform

Meta-package that includes all Brixa.Identity NuGet packages for consuming services.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 140 4/27/2026