ClaimsIdentity class

Represents a claims-based identity.

Constructors

ClaimsIdentity(Claim[], string | boolean)

Initializes a new instance of the ClaimsIdentity class.

Properties

claims
isAuthenticated

Returns authentication status.

Methods

getClaimValue(string)

Returns a claim value (if its present)

Constructor Details

ClaimsIdentity(Claim[], string | boolean)

Initializes a new instance of the ClaimsIdentity class.

new ClaimsIdentity(claims: Claim[], authenticationType?: string | boolean)

Parameters

claims

Claim[]

An array of Claim.

authenticationType

string | boolean

The type of auth for this set of claims, or boolean to override isAuthenticated

Property Details

claims

claims: Claim[]

Property Value

Claim[]

isAuthenticated

Returns authentication status.

boolean isAuthenticated

Property Value

boolean

True if is authenticated.

Method Details

getClaimValue(string)

Returns a claim value (if its present)

function getClaimValue(claimType: string): string | null

Parameters

claimType

string

The claim type to look for

Returns

string | null

The claim value or null if not found