jwt-inspector

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

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

Go to latest
Published: Jan 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

jwt-inspector - inspect your JWTs

jwt-inspector is an service that consumes JWT bearer tokens, validates them using a provided JWKS URI, and echoes the JWT payload in the response.

Getting started

jwt-inspector is a Go service. To install it, use go build or run:

go install github.com/jnschaeffer/jwt-inspector@latest

Usage

To run jwt-inspector, set the JWKS_URI environment variable to the URI containing the JWKS you want to validate tokens against and run the binary:

JWKS_URI=https://example.com/.well-known/jwks.json jwt-inspector

You can also set the listening address for the service using the ADDR environment variable.

Once running, jwt-inspector will accept requests on / and echo JWT payloads.

The following example should give you an idea of how to use the service:

$ read -s AUTH_TOKEN
$ curl -s --oauth2-bearer "$AUTH_TOKEN" http://localhost:8000/ | jq
{
  "aud": "https://auth.example.com/",
  "exp": 1674233937,
  "iat": 1674147537,
  "iss": "https://auth.example.com/",
  "scope": "openid profile email",
  "sub": "0e5ed04b-d67f-4559-9ee6-46567cfd16da"
}

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