-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove "--prn" option or make it optional on encode #114
Comments
@erhhung I didn't experience that argument as required. Can you post an example usage? |
The version I ran was v3.2.1 as that was the latest published in Homebrew (and still is). ./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=john.doe@foo.com" \
--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 $ ./jwt encode \
--iss https://foo.com \
--sub john.doe \
-P "jti=$(uuidgen)" \
-P "email=john.doe@foo.com" \
--exp "+1 hr" \
--secret secret
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImpvaG4uZG9lQGZvby5jb20iLCJleHAiOjE2MTMxNTI1NjUsImlhdCI6MTYxMzE0ODk2NSwiaXNzIjoiaHR0cHM6Ly9mb28uY29tIiwianRpIjoiMzUwOWNkNjgtNTI3OC00NmRlLTllODQtZmVjYzAyM2I0NGE2Iiwic3ViIjoiam9obi5kb2UifQ.0BKPhlWe41JVX_7mOLrAJJ1SfW1aAOcLw1P3y05psKU |
Thanks @erhhung! I'm not sure which spec I read when I first created this tool, but |
Removed in 4.0.0 |
Summary
According to the latest JWT spec (https://tools.ietf.org/html/rfc7519#page-9), the "
prn
" claim is not even mentioned, and according to an earlier JWT draft spec (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-05#page-9), the "prn
" claim is optional.Steps to reproduce
On encode, I get an error that the "
--prn
" required argument was not provided:Expected behavior
The "
--prn
" option should either be removed entirely or at least be made optional.The text was updated successfully, but these errors were encountered: