auth0jwt-decode | jwt-decode angular
IMPORTANT:Thislibrarydoesntvalidatethetoken,anywellformedJWTcanbedecoded.Youshouldvalidatethetokeninyourserver-sidelogicbyusingsomethinglikeexpress-jwt[1],koa-jwt[2],OwinBearerJWT[3],etc.📚Documentation-🚀GettingStarted-💬Feedback[4][5][6]DocumentationDocssite[7]-exploreourdocssiteandlearnmoreaboutAuth0.GettingstartedInstallationInstallwithNPMorYarn.Runnpminstalljwt-decodeoryarnaddjwt-decodetoinstallthelibrary.Usageimportjwt_decodefrom"jwt-decode";vartoken="eyJ0eXAiO...///jwttoken";vardecoded=j...
IMPORTANT: This library doesnt validate the token, any well formed JWT can be decoded. You should validate the token in your server-side logic by using something like express-jwt[1], koa-jwt[2], Owin Bearer JWT[3], etc.
📚 Documentation - 🚀Getting Started - 💬 Feedback[4][5][6]
Documentation Docs site[7] - explore our docs site and learn more about Auth0. Getting started InstallationInstall with NPM or Yarn.
Run npm install jwt-decode or yarn add jwt-decode to install the library.
Usage import jwt_decode from "jwt-decode"; var token = "eyJ0eXAiO.../// jwt token"; var decoded = jwt_decode(token); console.log(decoded); /* prints: * { * foo: "bar", * exp: 1393286893, * iat: 1393268893 * } */ // decode header by passing in options (useful for when you need `kid` to verify a JWT): var decodedHeader = jwt_decode(token, { header: true }); console.log(decodedHeader...