
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
cognito-jwt-verifier
Advanced tools
Verifies and decodes an AWS Cognito JWT token.
Warning AWS now supports their own library for this purpose. You likely want to use it instead:
yarn add cognito-jwt-verifier
npm install cognito-jwt-verifier
Simple example:
import CognitoJwtVerifier from "cognito-jwt-verifier";
const verifier = new CognitoJwtVerifier();
verifier.verifyToken({
token: 'AwsCognitoToken',
aws_region: 'us-east-1',
userpool_id: 'AwsUserpoolId',
userpool_client_id: 'AwsUserpoolClientId'
}).then((decoded_token)=>{
// Token is valid
console.log(decoded_token);
}).catch((err)=>{
// Token is invalid or another error occurred
console.error(err)
});
This package is based on information from the following AWS documentation: https://aws.amazon.com/premiumsupport/knowledge-center/decode-verify-cognito-json-token/
It performs the following tasks:
kid
(key ID) from the token header, and uses it to retrieve the correct public key from AWS.aud
token property matches the ID of the intended AWS userpool client.If you believe there may be a security flaws in this implementation, please open an issue ASAP.
returns a promise:
MIT. Copyright © 2022 Travis Wimer
FAQs
Verifies and decodes an AWS Cognito JWT token.
We found that cognito-jwt-verifier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.