Compartir a través de


ClaimsPrincipalExtensions.GetTenantId(ClaimsPrincipal) Method

Definition

Gets the Tenant ID associated with the ClaimsPrincipal.

public static string? GetTenantId (this System.Security.Claims.ClaimsPrincipal claimsPrincipal);
static member GetTenantId : System.Security.Claims.ClaimsPrincipal -> string
<Extension()>
Public Function GetTenantId (claimsPrincipal As ClaimsPrincipal) As String

Parameters

claimsPrincipal
ClaimsPrincipal

The ClaimsPrincipal from which to retrieve the tenant ID.

Returns

Tenant ID of the identity, or null if it cannot be found.

Remarks

This method returns the tenant ID both in case the developer has enabled or not claims mapping.

Applies to