logoalt Hacker News

hparadizyesterday at 7:55 PM1 replyview on HN

The cost of the stateless token is basically the CPU usage for signing the message and checking the signature with the public key on the client. Example: Google Compute Instance asks metadata server for OIDC token (which is a JWT). The metadata server respond with the token that basically says "here's the machine service account, here's the machines ID, this token is proof that I am service account abc123 and it's valid for 20 seconds". This is one of the most common uses of JWTs in enterprise. You don't store them. They actually are free.

Lots of web devs get tricked into using them as primary session tokens and it's a huge anti pattern. I see it all the time and people get aggressive about it.


Replies

agwayesterday at 8:12 PM

The cost is the vigilance required to use them safely. It's not just compute/storage costs.

show 1 reply