Brixa.Identity.AspNetCore 1.0.0

dotnet add package Brixa.Identity.AspNetCore --version 1.0.0
                    
NuGet\Install-Package Brixa.Identity.AspNetCore -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.AspNetCore" 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.AspNetCore" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Brixa.Identity.AspNetCore" />
                    
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.AspNetCore --version 1.0.0
                    
#r "nuget: Brixa.Identity.AspNetCore, 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.AspNetCore@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.AspNetCore&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Brixa.Identity.AspNetCore&version=1.0.0
                    
Install as a Cake Tool

Brixa.Identity.AspNetCore

JWT authentication, current user access, and middleware for ASP.NET Core services.

Install

dotnet add package Brixa.Identity.AspNetCore

Setup

// Program.cs
builder.Services.AddBrixaIdentity(builder.Configuration);

app.UseBrixaCorrelationId();
app.UseBrixaExceptionHandling();
app.UseAuthentication();
app.UseAuthorization();

Configuration

{
  "BrixaIdentity": {
    "Authority": "https://identity.internal",
    "Audience": "brixa-platform",
    "RequireHttpsMetadata": true,
    "ServiceAccountUserType": "ServiceAccount",
    "EnableTokenRevocationCheck": false,
    "TokenRevocationCacheDurationSeconds": 300
  }
}

ICurrentUser

Inject ICurrentUser to access the authenticated user's claims:

public class OrderService(ICurrentUser currentUser)
{
    public void CreateOrder()
    {
        var userId = currentUser.UserId;
        var merchant = currentUser.MerchantReference;
        var isAdmin = currentUser.HasRole("SuperAdmin");
        var canApprove = currentUser.HasPermission("merchant.kyc.approve");
        var isService = currentUser.IsServiceAccount;
    }
}

Available Properties

Property Type Description
UserId Guid? User ID from JWT
Username string? Username
Email string? Email address
PhoneNumber string? Phone number
MerchantReference string? Merchant reference
TenantId string? Tenant ID
UserType string? User type (Internal, Merchant, etc.)
ClientId string? Client ID (service accounts)
Jti string? JWT token ID
Roles IReadOnlyList<string> All roles
Permissions IReadOnlyList<string> All permissions
Scopes IReadOnlyList<string> All scopes
IsAuthenticated bool Whether user is authenticated
IsServiceAccount bool Whether this is a service-to-service call

Middleware

Correlation ID

Adds X-Correlation-Id header to all requests/responses for distributed tracing:

app.UseBrixaCorrelationId();

Exception Handling

Returns standardized error responses and logs unhandled exceptions:

app.UseBrixaExceptionHandling();

Token Revocation Check

Enable to validate access token JTIs against the Identity Service:

{
  "BrixaIdentity": {
    "EnableTokenRevocationCheck": true,
    "TokenRevocationCacheDurationSeconds": 300
  }
}

Uses a fail-open strategy — if the Identity Service is unreachable, requests are allowed through.

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.AspNetCore:

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 145 4/27/2026