UNPKG

cognito-jwt-token-validator

Version:

A JWT token validator to be used with cognito based custom authorizers.

26 lines (25 loc) 722 B
export declare class Validator { private iss; private aud; private fakeAuth; private pems?; /** * * @param iss Issuer * @param aud Audience * @param fakeAuth Set this to true this when you don't want to validate the * JWT token. Default: false * */ constructor(iss: string, aud: string, fakeAuth?: boolean); /** * * @param token JWT Token. Can be empty or anything if running in fakeAuth * mode * @throws Upon unsuccessful validation of token * @returns Decoded payload data of the JWT token upon successful validation. */ validate(token?: string): Promise<{ [key: string]: string; }>; }