JwtTokenExtractor class
A JWT token processing class that gets identity information and performs security token validation.
Constructors
Jwt |
Initializes a new instance of the JwtTokenExtractor class. Extracts relevant data from JWT Tokens. |
Properties
open |
|
token |
Methods
get |
Gets the claims identity associated with a request. |
get |
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
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
.