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
<PackageReference Include="Brixa.Identity.AspNetCore" Version="1.0.0" />
<PackageVersion Include="Brixa.Identity.AspNetCore" Version="1.0.0" />
<PackageReference Include="Brixa.Identity.AspNetCore" />
paket add Brixa.Identity.AspNetCore --version 1.0.0
#r "nuget: Brixa.Identity.AspNetCore, 1.0.0"
#:package Brixa.Identity.AspNetCore@1.0.0
#addin nuget:?package=Brixa.Identity.AspNetCore&version=1.0.0
#tool nuget:?package=Brixa.Identity.AspNetCore&version=1.0.0
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 | Versions 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. |
-
net8.0
- Brixa.Identity.Client (>= 1.0.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.11)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 8.0.11)
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 |