4 ms·
> Any verifier with a public verification key can determine if the JWT is bogus So you have to check a signature, right? Maybe this is what the other commenter
by GTP 3y ago
> Any verifier with a public verification key can determine if the JWT is bogus
So you have to check a signature, right? Maybe this is what the other commenter meant when mentioned encryption.
- marcus_holmes 3y agoYeah. The mechanics of JWTs are complex, involving maths that is easy to get wrong. Hopefully the implementation is based on a standard library and the author didn't roll their own crypto. Hopefully the library hasn't got any known vulnerabilities. Hopefully the implementation hasn't got any problems. Because the JWT actually contains sensitive information that is useful to an attacker, and if they can forge their own JWTs then the system is wide open; all the attacker needs to do is work out the username of an admin (or worse, the JWT itself tells the system if the user is an admin). Session IDs don't have any of these problems. It does mean you have to do a database lookup on every request, and that can cause problems with scale, but if you have to hit the database anyway for other reasons then you have that problem anyway and have to solve it for those other reasons.