更新时间:2023-12-02 09:46:16
更新:
您无需读取数据库即可验证JWT.JWT是一个已签名的令牌,您需要的只是用于验证JWT的密钥.
You shouldn't need to read database to validate a JWT. JWT is a signed token, all you need is the secret key to validate the JWT.
旧答案:
(注意:下图对于JWT来说是多余的,因为JWT已经是一个已签名的令牌,可以进行验证而无需保存在任何地方.但是,该图适用于基于cookie的情况验证.)
(Note: The diagram below is rather redundant for JWT, as a JWT is already a signed token and can be validated without needing to be saved anywhere. This diagram, however, works for cookie based auth.)
您可以使用消息代理(例如Redis)在Django和Tornado之间共享身份验证令牌:
You can share auth tokens between Django and Tornado using a message broker (such as Redis):
Redis快速,轻巧,您可以从Tornado异步连接它.
Redis is fast and lightweight and you can connect with it asynchronously from Tornado.
这里不需要芹菜.