If the token expires and the client gives you a 401 .. What's the process for renewal? Is it possible to renew via query to the agent directly? Or do you have to rerun the process for genenration on the commandline?
Answer by Prabhat Jha · Oct 06, 2015 at 09:15 PM
One of the reasons you get to deploy JWT app to your org is so that you can modify it to have your own expiryTime or your own credentials verification. Currently it does not have functionality to refresh token.
What would be advantage of exposing JWT end point through EdgeMicro other than one less URL that client has to know about?
Answer by seshi · Oct 06, 2015 at 06:56 AM
When a token is issues, you would get expires_in value in no.of seconds. You can use this value to decide to request for a new token or not. Renewing the same token wouldn't be feasible once issues with certain expiry time.
"token_type": "BearerToken", "expires_in": "3599",
For more info, can you let me know the Oauth grant type you are implementing.
Thanks, Seshi
Hi @seshi,
So when I fetch the token using the command line like so:
./edgemicro token get -o geirsjurseth -e test -i <client_id> -s <client_secret>
I don't see an expiry. In fact, if I take that resulting token and check it on jwt.io it decrypts part of it, but then tells me it's invalid (not sure whether that's relevant). But even if I do... How do I rewnew with edgemicro? Is there an endpoint for doing that on the agent? Or would I need to rerun the commandline. When I looked in the code I could see that it was ultimately connecting to cloud on config[authUri]/token to get the info... That authUri, I assume, is coming from the default.yaml.
Is there another way?
/geir
Thanks for clarifying. @Prabhat Jha can you please provide your inputs.