Google IoT JWT expiration

666 Views Asked by At

Which is the maximun life of a JWT to use with Google Cloud IoT?

I have seen this JWT but i'm not sure about how to use this:

The maximum lifetime of a token is 24 hours + skew

Thanks

1

There are 1 best solutions below

2
On BEST ANSWER

The documentation you link is correct. The maximum life of a JWT token for IoT is 24 hours. Although it mentions skew, I recommend against including that in the life-time of a token as it's intended as a buffer zone so that if your clock is a few minutes ahead of Google's no early expiration will occur.

What this means in practice is Google will accept JWT tokens with an exp field that between now and one day from now.

What this means for you, is that when you create a JWT token, you should set the exp field to the current time + 24 hours (or less, if you want to refresh more often).