by akira2501 · 3y ago · 0 comments
There's the middle ground as well with a long lived authentication or refresh token and a short lived authorization token.
> I want to include role (or other) information directly in the token for the sake of convenience
Once I started seriously developing cloud solutions, this became indispensable. It's not just convenient, it directly reduces expenses.
JWT tokens definitely have their place, I don't want to imply that they're useless. They're a tool with tradeoffs like every other tool we use. But I've seen a lot of projects using them without understanding those tradeoffs, and then creating either very inefficient, overly complex, or subtly insecure applications as a result.
This works up until a certain point. Once you get past simple RBAC to more fine-grained (resource-based) authz, jwts don't scale: https://medium.com/building-carta/authz-cartas-highly-scalab...