flaskflask-jwt-extended

How to store jwt token in redis in flask-jwt-extended?


I want to know how flask-jwt-extended works with autoscaling environment and is there any way to store token in centralized server (redis) and access over all autoscaling instances.


Solution

  • The only time tokens are stored is if you are blacklisting them. Otherwise JWTs don’t require any state on the backend. If you do want to use redis in conjunction with blacklisting, how you setup the redis instance for you flask applications is entirely up to you. Flask-jwt-extended does not handle that for you.

    https://flask-jwt-extended.readthedocs.io/en/latest/blocklist_and_token_revoking/