logoalt Hacker News

agwayesterday at 7:50 PM1 replyview on HN

Fair enough, but those optimizations are basically free. People think stateless tokens are free but they really are not.


Replies

hparadizyesterday at 7:55 PM

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.

show 1 reply