Hacker News

Subscribe to Hacker News feed
Hacker News RSS
Updated: 29 min 16 sec ago

The Pac-Man Dossier (2015)

Fri, 03/28/2025 - 5:31am

Article URL: https://pacman.holenet.info/

Comments URL: https://news.ycombinator.com/item?id=43503263

Points: 1

# Comments: 0

Categories: Hacker News

Ugly Code and Dumb Things

Fri, 03/28/2025 - 5:01am
Categories: Hacker News

What I've Learned by Building to Last

Fri, 03/28/2025 - 4:59am
Categories: Hacker News

Ask HN: What do you think about this JWT revocation strategy?

Fri, 03/28/2025 - 4:58am

I am building an application and I do not indent to use token by reference, so using JWTs. But there is a requirement that admins need to be able to revoke user sessions, which would require storing revoked unexpired JWTs, their ids or some hash on the DB and add an extra lookup. Doing this for a user means revoking all JWTs they might have generated if they are using multiple devices, and we don't know which tokens to revoke.

My solution is to add 2 claims (id and sid) and sign sid with a user secret before signing the token with the app secret.

When a token comes in, I first validate it with the app secret. If not valid or expired, we return a 401.

If valid, I validate the sid with the user secret since I now know who it belongs to.

The extra lookup for the user's secret then adds minimal overhead because we've already pre authenticated and can be considered business logic.

Thus, revoking all user sessions requires simply changing the user's secret.

What do you guys think about this? Any holes?

Comments URL: https://news.ycombinator.com/item?id=43503095

Points: 1

# Comments: 0

Categories: Hacker News

ByteDance Releases MegaTTS3

Fri, 03/28/2025 - 4:46am
Categories: Hacker News

On Tyranny [book]

Fri, 03/28/2025 - 4:45am

Article URL: https://timothysnyder.org/on-tyranny

Comments URL: https://news.ycombinator.com/item?id=43503004

Points: 1

# Comments: 0

Categories: Hacker News

Pages