node-aws-verify-jwt

    1.0.3 • Public • Published

    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

    Install

    npm i node-aws-verify-jwt

    DownloadsWeekly Downloads

    2

    Version

    1.0.3

    License

    ISC

    Unpacked Size

    5.67 kB

    Total Files

    5

    Last publish

    Collaborators

    • moritzroessler