Hello,
I have generated the JWT Token for working with Mender API’s and I tested an API to get list of users and devices and it worked fine, but after restarting the server the JWT Token is just gone, I am able to execute API’s, but on executing " echo $JWT " it gives me blank output instead of JWT Token value. So I would like to know that why this value suddenly disappeared on restarting the server and I would also like to know that how can I get the path where this token is stored on creation.
1] I want to know that for how long is this JWT Token valid?
2] How can I renew it on expiration of the Token?
3] I can see the JWT Token value by using echo command, but is there a way through which I can get the absolute path of where the Token has been stored?
Thanks and regards.
- The
JWT
token should be valid for a week I think. - Re-authorize with pwd and username
- The token (if I assume correctly, that this is on your development laptop), is not stored anywhere. It is a string of text. If the documentation told you to store it in
JWT
, that is an environment variable local to your shell. If you want this value to persist between shells and reboot, you need to store it somewhere permanent, like a file
1 Like
@oleorhagen Ok that helps , just one more thing does the token auto-renew itself or we need to manually do that.
Well I read somewhere that it auto-renews but just wanted to be sure.
does the token auto-renew itself or we need to manually do that.
You have to manually renew it, though if you store the secrets on the server then of course you can do it automatically as well.
Well I read somewhere that it auto-renews but just wanted to be sure.
This might be related to the Mender client JWT which is auto-renewed by the Mender client. But this authorization flow works differently then the management API’s
Thanks @mirzak
I am using JWT Token for API execution, so from your response I consider that it isn’t auto-renewable
That is correct.