JwtTokenExtractor class

A JWT token processing class that gets identity information and performs security token validation.

Constructors

JwtTokenExtractor(VerifyOptions, string, string[])

Initializes a new instance of the JwtTokenExtractor class. Extracts relevant data from JWT Tokens.

Properties

openIdMetadata
tokenValidationParameters

Methods

getIdentity(string, string, string, string[])

Gets the claims identity associated with a request.

getIdentityFromAuthHeader(string, string, string[])

Gets the claims identity associated with a request.

Constructor Details

JwtTokenExtractor(VerifyOptions, string, string[])

Initializes a new instance of the JwtTokenExtractor class. Extracts relevant data from JWT Tokens.

new JwtTokenExtractor(tokenValidationParameters: VerifyOptions, metadataUrl: string, allowedSigningAlgorithms: string[])

Parameters

tokenValidationParameters

VerifyOptions

Token validation parameters.

metadataUrl

string

Metadata Url.

allowedSigningAlgorithms

string[]

Allowed signing algorithms.

Property Details

openIdMetadata

openIdMetadata: OpenIdMetadata

Property Value

tokenValidationParameters

tokenValidationParameters: VerifyOptions

Property Value

VerifyOptions

Method Details

getIdentity(string, string, string, string[])

Gets the claims identity associated with a request.

function getIdentity(scheme: string, parameter: string, channelId: string, requiredEndorsements?: string[]): Promise<ClaimsIdentity | null>

Parameters

scheme

string

The associated scheme.

parameter

string

The token.

channelId

string

The Id of the channel being validated in the original request.

requiredEndorsements

string[]

The required JWT endorsements.

Returns

Promise<ClaimsIdentity | null>

A Promise representation for either a ClaimsIdentity or null.

getIdentityFromAuthHeader(string, string, string[])

Gets the claims identity associated with a request.

function getIdentityFromAuthHeader(authorizationHeader: string, channelId: string, requiredEndorsements?: string[]): Promise<ClaimsIdentity | null>

Parameters

authorizationHeader

string

The raw HTTP header in the format: "Bearer [longString]".

channelId

string

The Id of the channel being validated in the original request.

requiredEndorsements

string[]

The required JWT endorsements.

Returns

Promise<ClaimsIdentity | null>

A Promise representation for either a ClaimsIdentity or null.