Skip to content

Instantly share code, notes, and snippets.

View afraz-khan's full-sized avatar
☁️
data is reality

Afraz Khan afraz-khan

☁️
data is reality
View GitHub Profile
@afraz-khan
afraz-khan / AWS_COGNITO_JWT_VERIFIER.ts
Last active April 27, 2023 14:29
AWS Cognito JWT Verification Algorithm | TypeScript
import jwkToPem from 'jwk-to-pem';
import jwt, {JwtPayload, VerifyCallback, VerifyOptions} from 'jsonwebtoken';
import {AppConfig} from '../AppConfig';
import JsonWebTokenException from '../../exception/JsonWebTokenException';
export class CognitoJWTVerifier {
/*
This is application config object having all cognito params.
*/