Freigeben über


TenantContextHelper Class

Definition

Helper class for extracting tenant and worker context from ASP.NET Core HttpContext. Provides standardized ways to retrieve tenant and worker IDs from various sources including claims, headers, and request items.

public static class TenantContextHelper
type TenantContextHelper = class
Public Class TenantContextHelper
Inheritance
TenantContextHelper

Fields

Name Description
TenantClaimName

Claim name used to store tenant identifier in ClaimsPrincipal.

TenantHeaderName

Header name expected to contain tenant identifier.

TenantItemKey

HttpContext.Items key expected to contain tenant identifier.

WorkerClaimName

Claim name used to store worker identifier in ClaimsPrincipal.

WorkerHeaderName

Header name expected to contain worker identifier.

WorkerItemKey

HttpContext.Items key expected to contain worker identifier.

Methods

Name Description
GetTenantId(HttpContext)

Extracts the tenant ID from the HttpContext. Checks in order: user claims, request headers, and request items.

GetWorkerId(HttpContext)

Extracts the worker ID from the HttpContext. Checks in order: user claims, request headers, and request items.

Applies to