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
Subject
The subject and name used to identify the system actor in audit trails.
public const string Subject = "[System]"
Field Value
Methods
WithRoles(params string[])
Creates an authenticated system ClaimsPrincipal carrying the given roles.
public static ClaimsPrincipal WithRoles(params string[] roles)
Parameters
rolesstring[]The roles the system actor holds.
Returns
- ClaimsPrincipal
An authenticated ClaimsPrincipal with a role claim for each role.