UNPKG

@xeedware/cognito-jwt

Version:

AWS Cognito AccessToken and IdToken classes.

49 lines (48 loc) 1.29 kB
import { VerifyOptions } from 'jsonwebtoken'; export declare abstract class JsonWebToken { protected token: string; protected pem?: string; protected options: VerifyOptions; protected header: object; protected payload: any; protected signature: string; /** * Constructs a new CognitoJwtToken object * @param {string} token The JWT token. * @param {string} [pem] * @param {VerifyOptions} [options] */ constructor(token: string, pem?: string, options?: VerifyOptions); protected getJwtPayload<T>(): T; /** * Get the JWT payload * @returns {Object} */ getPayload(): object; /** * Get the encoded JSON Web Token string. * * @deprecated since version 1.2.0. * Will be deleted in version 2.0.0. * Use getToken() instead. * * @returns {string} the record's token. */ getJwtToken(): string; /** * Get the encoded JSON Web Token string. * @returns {string} the record's token. */ getToken(): string; /** * Get decoded header. * @returns {string} */ getHeader(): object; /** * Get decoded signature. * @returns {string} */ getSignature(): string; getPropertyValue(propertyName: string): any; }