项目作者: emcrisostomo

项目描述 :
A shell library to decode JWT tokens
高级语言: Shell
项目地址: git://github.com/emcrisostomo/jwt-cli.git
创建时间: 2018-04-09T09:19:31Z
项目社区:https://github.com/emcrisostomo/jwt-cli

开源协议:GNU General Public License v3.0

下载


License

jwt-cli

jwt-cli is a shell library to decode JWT tokens.

Prerequisites

jwt-cli requires the following programs to be present on the ${PATH}:

  • jq: optional. If present, pretty output will be emitted.
  • base64 or openssl
  • zsh

Getting jwt-cli

A user who whishes to build this package should get a release
tarball
. A release tarball contains everything a user needs to build
the package on his system, following the instructions detailed in the
Installation section below and the INSTALL file.

A developer who wishes to modify this package should get the sources (either
from a source tarball or cloning the repository) and have the GNU Build System
installed on his machine. Please read README.gnu-build-system to get further
details about how to bootstrap this package from sources on your machine.

Getting a copy of the source repository is not recommended unless you are a
developer, you have the GNU Build System installed on your machine, and you know
how to bootstrap it on the sources.

Installation

See the INSTALL file for detailed information about how to configure and
install this package.

Usage

The following operation decodes a JWT token:

  1. $ jwt-decode token
  2. {
  3. "alg": "RS256",
  4. "typ": "JWT",
  5. "kid": "sbS_BWBm0GzfIQRnYWolcWDRnjqwDTY_Aq6Fn_boqKM"
  6. }
  7. {
  8. "jti": "271151a3-db11-4f37-a724-4cf9957774f4",
  9. "exp": 1530979706,
  10. "nbf": 0,
  11. "iat": 1523117306,
  12. "iss": "https://domain.com/auth/realms/realm",
  13. "aud": "app-name",
  14. "sub": "5132c417-d772-420e-b5db-401ea633dca1",
  15. "typ": "Bearer",
  16. "azp": "app",
  17. "auth_time": 0,
  18. "session_state": "84e6a759-e54d-4fd7-9fcf-bb51131aab89",
  19. "acr": "1",
  20. "allowed-origins": [
  21. ""
  22. ],
  23. "realm_access": {
  24. "roles": [
  25. "role0",
  26. "role1",
  27. "role2"
  28. ]
  29. },
  30. "resource_access": {
  31. "account": {
  32. "roles": [
  33. "manage-account",
  34. "manage-account-links",
  35. "view-profile"
  36. ]
  37. }
  38. },
  39. "custom-property": "1797"
  40. }

Bug Reports

Bug reports can be sent directly to the authors.


Copyright (c) 2018 Enrico M. Crisostomo

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see http://www.gnu.org/licenses.