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
                    
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="Franz.Common.Http.MultiTenancy" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Http.MultiTenancy" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Franz.Common.Http.MultiTenancy" />
                    
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 Franz.Common.Http.MultiTenancy --version 3.0.0
                    
#r "nuget: Franz.Common.Http.MultiTenancy, 3.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 Franz.Common.Http.MultiTenancy@3.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=Franz.Common.Http.MultiTenancy&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Http.MultiTenancy&version=3.0.0
                    
Install as a Cake Tool

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 ITenantResolver implementations.
  • A missing or unresolved tenant is rejected when RequireTenant is enabled.
  • Inactive tenants and failed tenant validation are rejected.
  • Authenticated requests require successful tenant membership authorization when RequireAuthenticatedAuthorization is 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.Current for 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 113 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 274 7/21/2026
2.2.19 181 7/19/2026
2.2.18 171 7/19/2026
2.2.17 684 7/12/2026
2.2.16 187 7/2/2026
2.2.15 179 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 196 6/6/2026
Loading failed