cognitoken-verifier
TypeScript icon, indicating that this package has built-in type declarations

0.0.21 • Public • Published

Cognitoken-Verifier

A class implementation to simplify the validation process of JWT generated by AWS Cognito as prescribed in https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-verifying-a-jwt.html

Install

npm install cognitoken-verifier

Usage

const { CognitokenVerifier } = require('cognitoken-verifier');

// Parameters for CognitoVerifier class
const appClientId = '<Enter app client Id of User Pool>';
const issuer = 'https://cognito-idp.<REGION>.amazonaws.com/<USERPOOLID>';

const verifier = new CognitokenVerifier(appClientId, issuer);

verifier.verify(['<Tokens>'], '<id/access>')
    .then(payload=>{
        //Verification Success
    })
    .catch(err=>{
        // Verification Fail
        // returns CognitokenError class
    })

Readme

Keywords

none

Package Sidebar

Install

npm i cognitoken-verifier

Weekly Downloads

2

Version

0.0.21

License

ISC

Unpacked Size

9.44 kB

Total Files

7

Last publish

Collaborators

  • henrybyhee