botframework-connector
Version:
Bot Connector is autorest generated connector client.
57 lines • 2.62 kB
TypeScript
/**
* @module botframework-connector
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Algorithm, VerifyOptions } from 'jsonwebtoken';
import { ClaimsIdentity } from './claimsIdentity';
import { OpenIdMetadata } from './openIdMetadata';
import { ProxySettings } from '@azure/core-http';
/**
* A JWT token processing class that gets identity information and performs security token validation.
*/
export declare class JwtTokenExtractor {
private static openIdMetadataCache;
readonly tokenValidationParameters: VerifyOptions;
readonly openIdMetadata: OpenIdMetadata;
/**
* Initializes a new instance of the [JwtTokenExtractor](xref:botframework-connector.JwtTokenExtractor) class. Extracts relevant data from JWT Tokens.
*
* @param tokenValidationParameters Token validation parameters.
* @param metadataUrl Metadata Url.
* @param allowedSigningAlgorithms Allowed signing algorithms.
* @param proxySettings The proxy settings for the request.
*/
constructor(tokenValidationParameters: VerifyOptions, metadataUrl: string, allowedSigningAlgorithms: string[] | Algorithm[], proxySettings?: ProxySettings);
private static getOrAddOpenIdMetadata;
/**
* Gets the claims identity associated with a request.
*
* @param authorizationHeader The raw HTTP header in the format: "Bearer [longString]".
* @param channelId The Id of the channel being validated in the original request.
* @param requiredEndorsements The required JWT endorsements.
* @returns A `Promise` representation for either a [ClaimsIdentity](botframework-connector:module.ClaimsIdentity) or `null`.
*/
getIdentityFromAuthHeader(authorizationHeader: string, channelId: string, requiredEndorsements?: string[]): Promise<ClaimsIdentity | null>;
/**
* Gets the claims identity associated with a request.
*
* @param scheme The associated scheme.
* @param parameter The token.
* @param channelId The Id of the channel being validated in the original request.
* @param requiredEndorsements The required JWT endorsements.
* @returns A `Promise` representation for either a [ClaimsIdentity](botframework-connector:module.ClaimsIdentity) or `null`.
*/
getIdentity(scheme: string, parameter: string, channelId: string, requiredEndorsements?: string[]): Promise<ClaimsIdentity | null>;
/**
* @private
*/
private hasAllowedIssuer;
/**
* @private
*/
private validateToken;
}
//# sourceMappingURL=jwtTokenExtractor.d.ts.map