jwt-decode

Decode JWT tokens; useful for browser applications.

  • 所有者: auth0/jwt-decode
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    2
      比较:

Github星跟踪图

jwt-decode is a small browser library that helps decoding JWTs token which are Base64Url encoded.

IMPORTANT: This library doesn't 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, koa-jwt, Owin Bearer JWT, etc.

Installation

Install with npm, bower, or downloading from the build directory of this repository.

Use with AMD, browserify or just include with an script tag.

Usage

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)

 /* prints:
  * { typ: "JWT",
  *   alg: "HS256" }
  */

Note: A falsy token will throw an error.

Can also be used with browserify or webpack by doing npm install jwt-decode and requiring:

var jwtDecode = require('jwt-decode');

Polymer Web Component

Can also be installed and used with Polymer-based wrapper.

Develop

Run grunt dev and fire a browser at http://localhost:9999/test_harness.html.

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.

主要指标

概览
名称与所有者auth0/jwt-decode
主编程语言TypeScript
编程语言JavaScript (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2014-02-24 19:18:02
推送于2025-06-17 03:20:33
最后一次提交
发布数30
最新版本名称v4.0.0 (发布于 )
第一版名称v1.0.1 (发布于 2015-03-02 14:43:37)
用户参与
星数3.3k
关注者数139
派生数339
提交数332
已启用问题?
问题数96
打开的问题数1
拉请求数195
打开的拉请求数5
关闭的拉请求数115
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?