Class SystemPrincipal

Namespace
Cratis.Arc.Authorization
Assembly
Cratis.Arc.Core.dll

Builds the ClaimsPrincipal used to represent a trusted system actor.

public static class SystemPrincipal
Inheritance
SystemPrincipal
Inherited Members

Fields

AuthenticationType

The authentication type used for the system principal. A non-empty authentication type makes IsAuthenticated return true.

public const string AuthenticationType = "System"

Field Value

string

Subject

The subject and name used to identify the system actor in audit trails.

public const string Subject = "[System]"

Field Value

string

Methods

WithRoles(params string[])

Creates an authenticated system ClaimsPrincipal carrying the given roles.

public static ClaimsPrincipal WithRoles(params string[] roles)

Parameters

roles string[]

The roles the system actor holds.

Returns

ClaimsPrincipal

An authenticated ClaimsPrincipal with a role claim for each role.