Skip to content

C5H8NNaO4/node-aws-verify-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verify AWS serverless cognito jwt tokens.

Setup

npm install node-aws-verify-jwt

Quick Start

import { getPayload, verifyJWT } from   'node-aws-verify-jwt';

//Verify integrity of the token and return the payload.
const payload = await getPayload({
    jwtToken,
    region,
    userPoolID,
});

//Verify the token and validate claims.
const valid = await verifyJWT({
    jwtToken,
    region,
    userPoolID,
    claims: {
        client_id: '22vik2co81f7reethfbm8sfat5b',
        exp: (val) => val > ~~(+new Date/1000)
    },
});

Build

npm run build

Runs babel src --out-dir lib

Test

npm run test

Runs jest

About

Verify aws cognito jwt tokens.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published