Download the PHP package maaarghk/magento-jwt-refresh-service without Composer
On this page you can find all versions of the php package maaarghk/magento-jwt-refresh-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maaarghk/magento-jwt-refresh-service
More information about maaarghk/magento-jwt-refresh-service
Files in maaarghk/magento-jwt-refresh-service
Package magento-jwt-refresh-service
Short Description Add an API service for refreshing Magento JWTs
License MIT
Informations about the package magento-jwt-refresh-service
magento-jwt-refresh-service
Adds an API endpoint POST /V1/integration/admin/token/refresh
to refresh the
JWT from the Authorization header. Does not currently do customer tokens but PRs
are welcome.
e.g.:
Shouldn't JWT be short lived and only extended using refresh tokens?
I guess. A typical recommendation is that refresh tokens should be valid for seven days, so I will accept a PR which validates that the provided JWT was not issued over 7 days ago. This module goes to the effort of ensuring that refreshing the token does not update the issue date, so it should not be too difficult to enforce a maximum age.
(You can use base64 -d on the above curl example to verify that the iat claims of the two tokens are the same, but the expt claim is extended.)
BYOT
If you aren't using bearer tokens but you are using JWT, you can provide a token to be refreshed like this:
Why so complicated
Help
I am unlikely to fulfil any feature requests, so please provide a merge request alongside any that you have.
MRs with tests also welcome - it should be straightforward enough to verify the token returned has the same claims and user context, and that the refreshed token still validates.
All versions of magento-jwt-refresh-service with dependencies
magento/module-jwt-user-token Version ^100.4.1