(no title)
asymptotically2 | 5 years ago
It seems like people create short lived JWTs and then pass some opaque token to an auth endpoint to get a new JWT signed whenever the old one expires, or they store the JWTs in a database so that they can be revoked, making me question their usefulness.
peanut-walrus|5 years ago
Alternatively, they have drank the microservice kool-aid and think that making a request to an AAA service every time the user wants to do something is just too much overhead (It isn't).
tialaramex|5 years ago
Think about all the people/organisations that emit tokens you trust, or trust tokens you emit. Would they fit in an elevator? A meeting room? A conference venue?
If the code that mints all your JWTs and the code that verifies them are two methods in a class running in the same service and maintained by the same team, that's a sign you probably didn't need JWTs and an opaque token was more likely what you should use.
notJim|5 years ago
wglb|5 years ago
coverj|5 years ago
shakna|5 years ago
To avoid the database lookup. Often you might want to hold some state, without the latency.
JWT is about your server being able to be stateless, whilst the client is stateful, which can speed up some... Irritating... Places of performance problems.
dgellow|5 years ago
IMHO JWTs only make sense in some constrained contexts, such as:
1. You want a report, click on “generate”
2. The processing starts, you receive a token to access the resource
3. Once the file is created you get can access it by using the token previously received
In those kind of short term and limited use cases they can make things a bit nicer as the “report generation service” only need to check the token.
But in practice JWTs are often used used as a general authentication/authorization mechanism, and that makes little sense (and brings a lot of overhead).