@strongnguyen/idtoken-verifier
v2.2.4
Published
A lightweight library to decode and verify RS JWT meant for the browser.
Downloads
9
Maintainers
Readme
A lightweight library to decode and verify RSA ID tokens meant for the browser.
:books: Documentation - :rocket: Getting Started - :computer: API Reference - :speech_balloon: Feedback
Documentation
- API Reference
- Docs Site - explore our Docs site and learn more about Auth0
Getting Started
Installation
Using npm in your project directory run the following command:
npm install idtoken-verifier
Verify an ID token
Import the library, create an instance of IdTokenVerifier
and call the verify
method to verify an ID token:
import IdTokenVerifier from 'idtoken-verifier';
const verifier = new IdTokenVerifier({
issuer: 'https://my.auth0.com/',
audience: 'gYSNlU4YC4V1YPdqq8zPQcup6rJw1Mbt'
});
verifier.verify(id_token, nonce, (error, payload) => {
if (error) {
// handle the error
return;
}
// do something with `payload`
});
API Reference
Feedback
Contributing
We appreciate feedback and contribution to this repo! Before you get started, please see the following:
Raise an issue
To provide feedback or report a bug, please raise an issue on our issue tracker.
Vulnerability Reporting
Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.