Interface IPrincipal
An security context for an identity, which can be used to check its authentication status and resource access.
public interface IPrincipal
- Extension Methods
Properties
AuthenticatedIdentity
Identity AuthenticatedIdentity { get; }
Property Value
AuthenticationCredentials
Credentials? AuthenticationCredentials { get; }
Property Value
Error
AuthenticationFailure? Error { get; }
Property Value
IsAuthenticated
Whether authentication was successful. If true, the AuthenticatedIdentity property is non-null. If false, the Error property is non-null.
bool IsAuthenticated { get; }
Property Value
Methods
AssertAuthorisation(Permission)
void AssertAuthorisation(Permission claim)
Parameters
claimPermission
CheckAuthorisation(Permission)
bool CheckAuthorisation(Permission claim)
Parameters
claimPermission
Returns
EnumerateRoles()
IEnumerable<string> EnumerateRoles()
Returns
Remarks
If HasRole() has already returned true for some role, it is not guaranteed to be returned from EnumerateRoles().
EnumerateTenants()
IEnumerable<Guid> EnumerateTenants()
Returns
Remarks
If CheckAuthorisation() has already returned true for some tenant, it is not guaranteed to be returned from EnumerateTenants().
HasRole(string)
bool HasRole(string name)
Parameters
namestring