moznion
January 31, 2018, 3:29am
#1
I referred the following topic: Jwt Token renewal - LoRa App Server - LoRa Server forum .
Then I explored the lora-app-server code, but I couldn’t find any way to generate a JWT token without the exp
property.
Referred: https://github.com/brocaar/lora-app-server/blob/c30f86bcc4f05a93c656d43633b4a72d73f04cb9/internal/storage/user.go#L415-L427
Is there any method to do that? If not, I wish an option to generate JWT immortal token.
I wrote a PoC patch: https://github.com/moznion/lora-app-server/commit/a6ca3895a15420ae2522ba511a3a68e27b681737
How does it?
brocaar
January 31, 2018, 7:37am
#2
You can generate your own JWT token. A JWT token is “nothing more” than a signed JSON object. So when you know the secret to sign this JSON object, you can define yourself (external from the LoRa Server project) what you want to put in your JWT token.
1 Like
moznion
January 31, 2018, 7:51am
#3
Thanks.
Basically, does that mean tokens that are generated in app-server are used only user console, right?
brocaar
January 31, 2018, 8:09am
#4
That is correct. For external integrations you should use your own token generation meganism.
1 Like
moznion
January 31, 2018, 8:17am
#5
I understood. Thank you so much!