Table of Contents

Interface IPrincipal

Namespace
The.Security
Assembly
Instagile.dll

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

Identity

AuthenticationCredentials

Credentials? AuthenticationCredentials { get; }

Property Value

Credentials

Error

AuthenticationFailure? Error { get; }

Property Value

AuthenticationFailure

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

bool

Methods

AssertAuthorisation(Permission)

void AssertAuthorisation(Permission claim)

Parameters

claim Permission

CheckAuthorisation(Permission)

bool CheckAuthorisation(Permission claim)

Parameters

claim Permission

Returns

bool

EnumerateRoles()

IEnumerable<string> EnumerateRoles()

Returns

IEnumerable<string>

Remarks

If HasRole() has already returned true for some role, it is not guaranteed to be returned from EnumerateRoles().

EnumerateTenants()

IEnumerable<Guid> EnumerateTenants()

Returns

IEnumerable<Guid>

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

name string

Returns

bool