-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
Allow for creation of tokens without exp #1007
Conversation
f9db198
to
d5374bf
Compare
Hello @chalasr . Any idea yet when you will have some time to review and consider this PR? |
Can we use |
I can sure try and make it work with |
I have removed the payload option from this patch. I still believe it is a good addition. We use a generated JWT token as an access token between two applications that reside on the same infrastructure. The token never leaves our network nor does it go to the user. But because we need a bit more context in the token, we add that via the payload. When we generate the token programmatically, we can add the payload without problems. Now I need a solution for the payload to be added by tokens generated from the command-line. I have created a second PR, but now with the additional payload option for your consideration. If you choose not to allow the additional payload, I can always create my own command to implement this, but I would really like this PR to be considered for next release. |
Command/GenerateTokenCommand.php
Outdated
->addOption('user-class', 'c', InputOption::VALUE_REQUIRED) | ||
->setDescription('Generates a JWT token with optional payload') | ||
->addArgument('username', InputArgument::REQUIRED, 'Username of user to be retreived from user provider') | ||
->addArgument('ttl', InputArgument::OPTIONAL, 'Ttl in seconds to be added to current time. If not provided, the ttl configured in the bundle will be used. Use 0 to generate token without exp', null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about making it an option instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no objection to that. Will amend accordingly.
Thank you @pluk77. |
Allow exp=0 to be set in the payload during creation, which will create a token without an EXP. Related to #676 and #889.