Table of Contents

Class PrincipalIdentity

Namespace
The.Web.Security
Assembly
Instagile.Web.Client.dll
public static class PrincipalIdentity
Inheritance
PrincipalIdentity
Inherited Members

Fields

ANONYMOUS_USERNAME

public const string ANONYMOUS_USERNAME = "anonymous"

Field Value

string

Methods

GetPrincipal(Identity, IEnumerable<string>)

Builds a .NET ClaimsPrincipal from The.Security components.

public static ClaimsPrincipal GetPrincipal(Identity identity, IEnumerable<string> roles)

Parameters

identity Identity
roles IEnumerable<string>

Returns

ClaimsPrincipal

GetRoles(ClaimsPrincipal)

public static IEnumerable<Role> GetRoles(ClaimsPrincipal user)

Parameters

user ClaimsPrincipal

Returns

IEnumerable<Role>

GetUsername(ClaimsPrincipal)

Extracts a The.Security identity from a .NET ClaimsPrincipal.

public static AuthenticationResult<string> GetUsername(ClaimsPrincipal user)

Parameters

user ClaimsPrincipal

Returns

AuthenticationResult<string>

VerifyUsername(ClaimsPrincipal, string, bool)

Checks whether a The.Security identity matches a .NET ClaimsPrincipal.

public static AuthenticationResult VerifyUsername(ClaimsPrincipal user, string subject, bool allowAnonymous)

Parameters

user ClaimsPrincipal
subject string
allowAnonymous bool

Returns

AuthenticationResult