decode-jwt

command module
v0.0.0-...-7a63aff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

README

decode jwt

A go library to help you decode a JSON Web Token (JWT)

Please read RFC 7519 for more details on JWT's

How to use this library

You can clone this library and run the following command:

go run jwtDecode.go -jwt=awtee123455

If you don't provide an argument of -jwt then you will receive a usage message

Install library in System

Run the command:

go get github.com/jbelmont/decode-jwt

Assuming that you have go installed and have set a GOPATH you can simply run:

jwt-decode -jwt=aTokenHere

You might need to add $GOPATH/bin to your PATH variable in .bashrc and .zshrc configuration files.

Sample Run

go run jwtDecode.go -jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
{
 "raw": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
 "headers": {
  "alg": "HS256",
  "typ": "JWT"
 },
 "claims": {
  "iat": 1516239022,
  "sub": "1234567890",
  "name": "John Doe"
 },
 "signature": "",
 "valid": false
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL