Giter Site home page Giter Site logo

jwt token 生成方式 about lion HOT 3 CLOSED

micyo202 avatar micyo202 commented on May 24, 2024
jwt token 生成方式

from lion.

Comments (3)

qiaoqiao888 avatar qiaoqiao888 commented on May 24, 2024

不使用jwt去注销token,是ok的。
如果使用jwt,调用revoke接口,token系统还是认识的,这个时候这个登出如何来做嘞。
很多是redis+jwt,不知道大佬这边有方式吗

from lion.

micyo202 avatar micyo202 commented on May 24, 2024

JWT 的特点是无状态的,若用JWT来实现用户注销,有点违背了 JWT 的初衷

不过这种场景也可以将每一个签发的 JWT 保存在 Redis 上,当出现上述的需求时,就更新对应的JWT,每次登录进行客户端与 Redis 中 JWT 的比对,若不同,那么登录失败,这种方法虽然可以解决问题,但是此时 JWT 似乎又变成了有状态的了,失去了JWT的优点,采用 access_token 的方式它不香吗?

from lion.

qiaoqiao888 avatar qiaoqiao888 commented on May 24, 2024

说的也是,目前jwt也没有其他的好办法处理了。

from lion.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.