jwtgen

command module
v0.0.0-...-d278f49 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

README

jwtgen

Table of Contents

  1. Description
  2. Usage
  3. Limitations
  4. References

Description

A command-line utility to create signed and encrypted JWT tokens with support for private claims.
Utilizes the fantastic go-jose library from Square: https://github.com/square/go-jose

A public key pem file (public.pem), encryption key (.sek), and JWT token (token) are generated and exported to the filesystem path specified by the --outdir parameter.

Usage

git clone https://github.com/czembower/jwtgen.git && cd jwtgen && go get -d ./... && go build
./jwtgen [args]

jwtgen arguments:

  • -audience [string] jwt token audience (default "audience")
  • -id [string] jwt token id (default "identifier")
  • -issuer [string] jwt token issuer (default "issuer")
  • -outdir [string] output directory to render assets (default "./output/")
  • -privateClaims [string] comma separated list of private claims in key=value format
  • -subject [string] jwt token subject (default "subject")
  • -ttl [string] ttl of token in seconds (default "86400")

Limitations

The RSA keypair can not currently be imported or specified, as it is generated by the utility at run time.

References

https://medium.com/@niceoneallround/jwts-in-go-golang-4e0151f899af

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