Table of Contents

Interface IPrincipalReader

Namespace
Arbiter.CommandQuery.Definitions
Assembly
Arbiter.CommandQuery.dll

Provides methods for reading claims from an IPrincipal or ClaimsPrincipal.

public interface IPrincipalReader

Remarks

This interface is designed to extract specific claims such as identifier, name, email, object ID, tenant ID, and display name from the provided IPrincipal or ClaimsPrincipal instance.

Methods

GetDisplayName(ClaimsPrincipal?)

Gets the display name claim from the specified claimsPrincipal.

string? GetDisplayName(ClaimsPrincipal? claimsPrincipal)

Parameters

claimsPrincipal ClaimsPrincipal

The claims principal to read the claim from.

Returns

string

The display name claim as a string if found; otherwise, null.

GetEmail(IPrincipal?)

Gets the email claim from the specified principal.

string? GetEmail(IPrincipal? principal)

Parameters

principal IPrincipal

The principal to read the claim from.

Returns

string

The email claim as a string if found; otherwise, null.

GetIdentifier(IPrincipal?)

Gets the identifier claim from the specified principal.

string? GetIdentifier(IPrincipal? principal)

Parameters

principal IPrincipal

The principal to read the claim from.

Returns

string

The identifier claim as a string if found; otherwise, null.

GetName(IPrincipal?)

Gets the name claim from the specified principal.

string? GetName(IPrincipal? principal)

Parameters

principal IPrincipal

The principal to read the claim from.

Returns

string

The name claim as a string if found; otherwise, null.

GetObjectId(IPrincipal?)

Gets the object identifier claim from the specified principal.

Guid? GetObjectId(IPrincipal? principal)

Parameters

principal IPrincipal

The principal to read the claim from.

Returns

Guid?

The object identifier claim as a Guid if found; otherwise, null.

GetTenantId(IPrincipal?)

Gets the tenant identifier claim from the specified principal.

string? GetTenantId(IPrincipal? principal)

Parameters

principal IPrincipal

The principal to read the claim from.

Returns

string

The tenant identifier claim as a string if found; otherwise, null.