All Projects → auth0 → Jwt Decode

auth0 / Jwt Decode

Licence: mit
Decode JWT tokens; useful for browser applications.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Labels

Projects that are alternatives of or similar to Jwt Decode

Spring Rest Ecommerce
Java Spring Boot - Ecommerce REST API
Stars: ✭ 164 (-93.01%)
Mutual labels:  jwt
Lexikjwtauthenticationbundle
JWT authentication for your Symfony API
Stars: ✭ 2,184 (-6.95%)
Mutual labels:  jwt
Mern
🌐 MERN stack 2.0 - MongoDB, Express, React/Redux, Node
Stars: ✭ 175 (-92.54%)
Mutual labels:  jwt
Spring Boot Security Jwt Spa
Spring Boot 2 + JWT + Spring Security 5的单页应用(SPA) Restful 解决方案
Stars: ✭ 166 (-92.93%)
Mutual labels:  jwt
Jwt Pwn
Security Testing Scripts for JWT
Stars: ✭ 170 (-92.76%)
Mutual labels:  jwt
Laravel Vue Spa
SPA Boilerplate made with Laravel 5.6, Vue 2, Bootstrap 4, Vue-router 3, Vuex 3, Axios
Stars: ✭ 172 (-92.67%)
Mutual labels:  jwt
Branca Spec
Authenticated and encrypted API tokens using modern crypto
Stars: ✭ 163 (-93.05%)
Mutual labels:  jwt
Febs Vue
SpringBoot,Shiro,JWT,Vue & Ant Design 前后端分离权限管理系统(精力有限,停止维护)
Stars: ✭ 2,079 (-11.42%)
Mutual labels:  jwt
React Jwt Authentication Example
React - JWT Authentication Tutorial & Example
Stars: ✭ 170 (-92.76%)
Mutual labels:  jwt
Jwt Hack
🔩 jwt-hack is tool for hacking / security testing to JWT. Supported for En/decoding JWT, Generate payload for JWT attack and very fast cracking(dict/brutefoce)
Stars: ✭ 172 (-92.67%)
Mutual labels:  jwt
Fastify Jwt
JWT utils for Fastify
Stars: ✭ 165 (-92.97%)
Mutual labels:  jwt
Liugh Parent
SpringBoot+SpringCloud Oauth2+JWT+MybatisPlus实现Restful快速开发后端脚手架
Stars: ✭ 2,112 (-10.01%)
Mutual labels:  jwt
Wp Graphql Jwt Authentication
Authentication for WPGraphQL using JWT (JSON Web Tokens)
Stars: ✭ 172 (-92.67%)
Mutual labels:  jwt
Cognito Express
Authenticates API requests on a Node application by verifying the JWT signature of AccessToken or IDToken generated by Amazon Cognito.
Stars: ✭ 165 (-92.97%)
Mutual labels:  jwt
Spring Boot Plus
🔥 Spring-Boot-Plus is a easy-to-use, high-speed, high-efficient,feature-rich, open source spring boot scaffolding. 🚀
Stars: ✭ 2,198 (-6.35%)
Mutual labels:  jwt
Security.identity
.NET DevPack Identity is a set of common implementations to help you implementing Identity, Jwt, claims validation and another facilities
Stars: ✭ 165 (-92.97%)
Mutual labels:  jwt
Jwt
JWT implementation in Crystal
Stars: ✭ 171 (-92.71%)
Mutual labels:  jwt
Jwtcat
A CPU-based JSON Web Token (JWT) cracker and - to some extent - scanner.
Stars: ✭ 181 (-92.29%)
Mutual labels:  jwt
Fastdep
Fast integration dependencies in spring boot.是一个快速集成依赖的框架,集成了一些常用公共的依赖。例:多数据源,Redis,JWT...
Stars: ✭ 178 (-92.42%)
Mutual labels:  jwt
Doorkeeper Jwt
JWT Token support for Doorkeeper
Stars: ✭ 174 (-92.59%)
Mutual labels:  jwt

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.


Warning: When upgrading from version 2 to 3, there's a potentially breaking change

If you've previously imported the library as import * as jwt_decode from 'jwt-decode', you'll have to change your import to import jwt_decode from 'jwt-decode';.


Sponsor

auth0 logo If you want to quickly add secure token-based authentication to your JavaScript projects, feel free to check Auth0's JavaScript SDK and free plan at auth0.com/developers

Installation

FOSSA Status

Install 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);

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

Note: A falsy or malformed token will throw an InvalidTokenError error.

Use with typescript

The jwt_decode function will return an unknown type by default. You can specify what the expected return type should be by passing a type argument to the jwt_decode function.

The package also exports types for a JwtHeader and JwtPayload with some default claims. You can either use them as-is, or extend them to include non standard claims or properties.

import jwtDecode, { JwtPayload } from "jwt-decode";

const token: string = "eyJhsw5c";
const decoded = jwtDecode<JwtPayload>(token); // Returns with the JwtPayload type

Use as a CommonJS package

const jwt_decode = require('jwt-decode');
...

Include with a script tag

Copy the file jwt-decode.js from the build/ folder to your project somewhere, then include like so:

<script src="jwt-decode.js"></script>

Older versions

If you want to use the library through Bower, an HTML import, use version v2.2.0. It has the same functionality.

Develop

Run npm run dev, this will fire up a browser and watch the /lib folder.

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.

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].