Totallytech.BranchAuth.Client 1.0.0
Totallytech.BranchAuth
Helpers for calling and receiving branch-scoped internal APIs through the token broker. Built for .NET 8 and .NET 10.
- Totallytech.BranchAuth.Client:
IBranchTokenClient.GetAsync(companyId, branchId, scope)gets a short-lived access token from the broker. The service proves its identity with its own identity server client (BranchTokenClient:CallerAuth = ClientCredentials, secret from its secret store) or, on Kubernetes, with the pod's projected service account token (ServiceAccountToken). Tokens are cached in memory until about 60 seconds before they expire.BranchNotEntitledException: the branch does not have the service or scope. This is a normal case and is not retried.- Broker 503, 429 and network errors are retried with backoff.
- Totallytech.BranchAuth.AspNetCore for receiving services:
- Already validating tokens from the identity server:
builder.Services.AddBranchTenantAuthorization()(adds only the scope policies andITenantContext). - No token validation yet:
builder.AddBranchApiAuth("rcm")(JWT bearer validation againstBranchApiAuth:Authoritywith the given audience, plus the above). - A policy for every scope name:
[Authorize(Policy = "rcm.claims.write")]or.RequireAuthorization("rcm.claims.write"). ITenantContextreads thecompanyIdandbranchIdclaims from the validated token only.
- Already validating tokens from the identity server:
- Totallytech.BranchAuth.EntityFrameworkCore:
modelBuilder.ApplyBranchTenantFilters(this)adds a global query filter onCompanyIdandBranchIdto everyITenantScopedentity.
See the token-broker repository README for configuration.
No packages depend on Totallytech.BranchAuth.Client.
.NET 10.0
- Microsoft.Extensions.Http (>= 10.0.15)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.15)
.NET 8.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 1.0.0 | 0 | 11/16/2026 |