Franz.Common.Http.MultiTenancy
3.0.0
dotnet add package Franz.Common.Http.MultiTenancy --version 3.0.0
NuGet\Install-Package Franz.Common.Http.MultiTenancy -Version 3.0.0
<PackageReference Include="Franz.Common.Http.MultiTenancy" Version="3.0.0" />
<PackageVersion Include="Franz.Common.Http.MultiTenancy" Version="3.0.0" />
<PackageReference Include="Franz.Common.Http.MultiTenancy" />
paket add Franz.Common.Http.MultiTenancy --version 3.0.0
#r "nuget: Franz.Common.Http.MultiTenancy, 3.0.0"
#:package Franz.Common.Http.MultiTenancy@3.0.0
#addin nuget:?package=Franz.Common.Http.MultiTenancy&version=3.0.0
#tool nuget:?package=Franz.Common.Http.MultiTenancy&version=3.0.0
Franz.Common.Http.MultiTenancy
Tenant resolution, membership authorization, and immutable tenant execution context for ASP.NET Core requests.
Overview
The HTTP integration resolves a tenant from application-registered strategies, validates its status, optionally validates membership for authenticated principals, resolves a verified domain, and establishes a request-scoped TenantExecutionContext.
The package does not treat a caller-supplied tenant identifier as authorization proof. Applications own the tenant store, resolver strategies, and membership policy.
Installation
dotnet add package Franz.Common.Http.MultiTenancy
Registration
using Franz.Common.Http.MultiTenancy.Extensions;
builder.Services.AddFranzMultiTenancy(options =>
{
options.RequireTenant = true;
options.RequireAuthenticatedAuthorization = true;
options.ExcludedPaths.Add("/health");
});
// Register the application's ITenantStore and one or more ITenantResolver
// implementations using the application's persistence and resolution rules.
// Register ITenantRequestAuthorizer for authenticated tenant membership.
AddFranzMultiTenancy registers the HTTP context accessors, tenant execution-context accessor, default resolution pipelines, middleware, options validation, and startup validation. It does not invent a tenant store or a resolver strategy. When tenant resolution is required, startup validation expects at least one ITenantResolver.
For authenticated requests, the default is fail-closed: an ITenantRequestAuthorizer must be registered. Applications with domain-specific membership, subscription, role, or delegated-access rules should implement this interface.
The package also provides an explicit GUID-claim membership authorizer:
builder.Services.AddTenantClaimsAuthorizer(options =>
{
options.TenantIdClaimType = "tenant_id";
});
This authorizer accepts only an authenticated principal whose configured claim parses to the exact resolved tenant GUID. It is a simple membership policy, not a substitute for richer authorization rules.
Middleware
Use UseFranzMultiTenancy() when composing the pipeline manually. With Franz.Common.Http.Bootstrap, UseHttpArchitecture() already inserts tenant resolution after authentication and before endpoint authorization; do not register the middleware twice.
The validated context is immutable for the duration of the request and is cleared in a finally block. Attempts to replace tenant or domain identity while the context is active are rejected. Request cancellation is propagated through resolution, validation, and authorization.
Resolution and security behavior
- Tenant resolution strategies are application-registered
ITenantResolverimplementations. - A missing or unresolved tenant is rejected when
RequireTenantis enabled. - Inactive tenants and failed tenant validation are rejected.
- Authenticated requests require successful tenant membership authorization when
RequireAuthenticatedAuthorizationis enabled. - Domain context is established only for a verified domain associated with the resolved tenant.
- Excluded paths are explicit path prefixes matched on segment boundaries, case-insensitively. Excluded endpoints bypass tenant resolution and must be secured independently.
- The root path cannot be excluded.
Accessing the validated context
Use the provider-neutral contracts from Franz.Common.MultiTenancy:
ITenantExecutionContextAccessor.Currentfor the immutable execution context.ITenantContextAccessor.GetCurrentTenantId()for the resolved tenant identifier.IDomainContextAccessor.GetCurrentDomainId()for the resolved domain identifier.
Do not read raw headers directly to establish trusted tenant identity.
License
MIT. See the repository LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Franz.Common.Headers (>= 3.0.0)
- Franz.Common.Http (>= 3.0.0)
- Franz.Common.Http.Headers (>= 3.0.0)
- Franz.Common.MultiTenancy (>= 3.0.0)
- Swashbuckle.AspNetCore.SwaggerGen (>= 10.2.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Franz.Common.Http.MultiTenancy:
| Package | Downloads |
|---|---|
|
Franz.Common.MongoDB
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Http.Bootstrap
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 115 | 11/10/2026 |
| 2.3.4 | 380 | 11/1/2026 |
| 2.3.3 | 344 | 10/28/2026 |
| 2.3.2 | 138 | 10/27/2026 |
| 2.3.1 | 194 | 10/26/2026 |
| 2.3.0 | 275 | 7/21/2026 |
| 2.2.19 | 181 | 7/19/2026 |
| 2.2.18 | 171 | 7/19/2026 |
| 2.2.17 | 732 | 7/12/2026 |
| 2.2.16 | 187 | 7/2/2026 |
| 2.2.15 | 180 | 6/29/2026 |
| 2.2.14 | 186 | 6/29/2026 |
| 2.2.13 | 176 | 6/29/2026 |
| 2.2.12 | 173 | 6/28/2026 |
| 2.2.11 | 170 | 6/28/2026 |
| 2.2.10 | 188 | 6/28/2026 |
| 2.2.9 | 180 | 6/28/2026 |
| 2.2.8 | 182 | 6/28/2026 |
| 2.2.7 | 181 | 6/7/2026 |
| 2.2.6 | 197 | 6/6/2026 |