Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.14 KB

README.md

File metadata and controls

37 lines (29 loc) · 1.14 KB

JWT Decode

Build Status codecov Go Reference Decodes JWT tokens without verification of keys.

Example

The following example prints a token file to stderr, and jwtdecode reads the token from stdin. jwtdecode can read from stdin, a single file, or a list of files. jwtdecode can also read multiple tokens in the same file that are separated by newlines.

cat token.jwt | tee -a /dev/stderr | jwtdecode
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
{
    "alg": "HS256",
    "typ": "JWT"
}
{
    "iat": 1516239022,
    "name": "John Doe",
    "sub": "1234567890"
}

Install

go get github.com/micahhausler/jwtdecode

License

MIT License. See LICENSE for full text.