JWT seems to be not secure solution for a REST API

Viewed 57

I am developing a REST API but JWT's looks wrong to me. We all calling them as "stateless tokens" but actually they brings a lot of problems.

We all say, they should not be stored in a database or memory cache solutions. But there are 3 core conditions about that API for me, please enlighten me about how can I implemented them without accessing / store them in DB.

  1. When user changes his password, the token should be invalidated immediately.
  2. When user log-out, the token should be invalidated immediately.
  3. The architecture should be available to scale horizontally easily. I don't want a trouble.

If we do database/cache lookups in each request for those conditions, JWT is a totally useless solution, Isn't it?

1 Answers
Related