Brixa.Identity.Client
1.0.0
dotnet add package Brixa.Identity.Client --version 1.0.0
NuGet\Install-Package Brixa.Identity.Client -Version 1.0.0
<PackageReference Include="Brixa.Identity.Client" Version="1.0.0" />
<PackageVersion Include="Brixa.Identity.Client" Version="1.0.0" />
<PackageReference Include="Brixa.Identity.Client" />
paket add Brixa.Identity.Client --version 1.0.0
#r "nuget: Brixa.Identity.Client, 1.0.0"
#:package Brixa.Identity.Client@1.0.0
#addin nuget:?package=Brixa.Identity.Client&version=1.0.0
#tool nuget:?package=Brixa.Identity.Client&version=1.0.0
Brixa.Identity.Client
Typed HTTP client for calling Brixa.Identity.Service with built-in resilience.
Install
dotnet add package Brixa.Identity.Client
Setup
builder.Services.AddBrixaIdentityHttpClient(builder.Configuration);
Or use the all-in-one setup:
builder.Services.AddBrixaIdentity(builder.Configuration);
Configuration
{
"BrixaIdentity": {
"BaseUrl": "https://identity.internal",
"ClientId": "your-service-name",
"ClientSecret": "from-secret-manager",
"RequiredScopes": ["identity.users.create"],
"TimeoutSeconds": 30,
"RetryCount": 3,
"CircuitBreakerFailureThreshold": 5,
"CircuitBreakerDurationSeconds": 30
}
}
Never put
ClientSecretin source control. Usedotnet user-secrets, environment variables, or AWS Secrets Manager.
Usage
IIdentityClient
public class OnboardingService(IIdentityClient identityClient)
{
public async Task<Guid> CreateMerchantUser(string email, string merchantRef)
{
var result = await identityClient.CreateUserAsync(new CreateUserRequest
{
FirstName = "Merchant",
LastName = "User",
Username = email,
Email = email,
UserType = "Merchant",
MerchantReference = merchantRef,
Roles = ["MerchantAdmin"]
});
if (!result.Success)
throw new Exception(result.ErrorMessage);
return result.Data!.UserId;
}
}
Available Methods
| Method | Description |
|---|---|
LoginAsync |
Authenticate user |
LogoutAsync |
Logout single device |
LogoutAllAsync |
Logout all devices |
RefreshTokenAsync |
Rotate refresh token |
RevokeTokenAsync |
Revoke a token |
GetTokenRevocationStatusAsync |
Check if JTI is revoked |
CreateUserAsync |
Create a new user |
GetUserByIdAsync |
Get user by ID |
GetUserByEmailAsync |
Get user by email |
GetUserByUsernameAsync |
Get user by username |
ActivateUserAsync |
Activate a pending user |
DisableUserAsync |
Disable a user |
ResetPasswordAsync |
Reset password with token |
ForgotPasswordAsync |
Request password reset |
ChangePasswordAsync |
Change password (authenticated) |
AssignRoleAsync |
Assign role to user |
AssignPermissionAsync |
Assign permission to user |
CheckPermissionAsync |
Check if user has permission |
GetUserPermissionsAsync |
Get all user permissions |
CreateServiceTokenAsync |
Get service-to-service token |
IServiceTokenProvider
For service-to-service calls, tokens are cached automatically:
public class MyDelegatingHandler(IServiceTokenProvider tokenProvider) : DelegatingHandler
{
protected override async Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request, CancellationToken cancellationToken)
{
var token = await tokenProvider.GetTokenAsync(cancellationToken);
request.Headers.Authorization = new("Bearer", token);
return await base.SendAsync(request, cancellationToken);
}
}
Resilience
Built-in Polly policies:
- Retry — 3 attempts with exponential backoff (configurable)
- Circuit Breaker — Opens after 5 failures, stays open for 30s (configurable)
- Timeout — 30s per request (configurable)
| 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.Abstractions (>= 1.0.0)
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Http.Resilience (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Brixa.Identity.Client:
| Package | Downloads |
|---|---|
|
Brixa.Identity.AspNetCore
ASP.NET Core integration for Brixa.Identity including JWT auth, current user, and middleware. |
|
|
Brixa.Identity.Authorization
Permission-based authorization for Brixa.Identity platform. |
|
|
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 | 176 | 4/27/2026 |