Giter Site home page Giter Site logo

Comments (4)

kljensen avatar kljensen commented on September 13, 2024

@erhhung I didn't experience that argument as required. Can you post an example usage?

from jwt-cli.

erhhung avatar erhhung commented on September 13, 2024

The version I ran was v3.2.1 as that was the latest published in Homebrew (and still is).
I just manually pulled down v3.3.0 and ran my example again, and I still see the issue:

./jwt --version
jwt 3.3.0

Full example:

$ ./jwt encode \
  --iss https://foo.com \
  --aud https://bar.com \
  --sub john.doe \
  -P "jti=$(uuidgen)" \
  -P "[email protected]" \
  --exp "+1 hr" \
  --secret secret

error: The following required arguments were not provided:
    --prn <principal>

USAGE:
    jwt encode --alg <algorithm> --aud <audience> --exp <expires> --iss <issuer> --prn <principal> --secret <secret> --sub <subject>

Minimal example:

$ ./jwt encode --aud https://bar.com --secret secret

error: The following required arguments were not provided:
    --prn <principal>

USAGE:
    jwt encode --alg <algorithm> --aud <audience> --exp <expires> --prn <principal> --secret <secret>

Full example without --aud option:

$ ./jwt encode \
  --iss https://foo.com \
  --sub john.doe \
  -P "jti=$(uuidgen)" \
  -P "[email protected]" \
  --exp "+1 hr" \
  --secret secret

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImpvaG4uZG9lQGZvby5jb20iLCJleHAiOjE2MTMxNTI1NjUsImlhdCI6MTYxMzE0ODk2NSwiaXNzIjoiaHR0cHM6Ly9mb28uY29tIiwianRpIjoiMzUwOWNkNjgtNTI3OC00NmRlLTllODQtZmVjYzAyM2I0NGE2Iiwic3ViIjoiam9obi5kb2UifQ.0BKPhlWe41JVX_7mOLrAJJ1SfW1aAOcLw1P3y05psKU

from jwt-cli.

mike-engel avatar mike-engel commented on September 13, 2024

Thanks @erhhung! I'm not sure which spec I read when I first created this tool, but prn was required if aud was present at the time. According to the current spec that you mentioned, however, it doesn't even seem to be specified. I'll remove it.

from jwt-cli.

mike-engel avatar mike-engel commented on September 13, 2024

Removed in 4.0.0

from jwt-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.