jwt

command
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 9 Imported by: 0

README

jwt command-line tool

This is a simple tool to sign, verify and show JSON Web Tokens from the command line.

The following will create and sign a token, then verify it and output the original claims:

 echo {\"foo\":\"bar\"} | ./jwt -key ../../test/sample_key -alg RS256 -sign - | ./jwt -key ../../test/sample_key.pub -alg RS256 -verify -

Key files should be in PEM format. Other formats are not supported by this tool.

To simply display a token, use:

echo $JWT | ./jwt -show -

You can install this tool with the following command:

 go install github.com/dgrijalva/jwt-go/cmd/jwt

Documentation

Overview

A useful example app. You can use this to debug your tokens on the command line. This is also a great place to look at how you might use this library.

Example usage: The following will create and sign a token, then verify it and output the original claims.

echo {\"foo\":\"bar\"} | bin/jwt -key test/sample_key -alg RS256 -sign - | bin/jwt -key test/sample_key.pub -verify -

Jump to

Keyboard shortcuts

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