Code Monkey home page Code Monkey logo

Comments (14)

woann avatar woann commented on May 23, 2024

新access_token不应该也按照配置文件的有效期生成吗?为什么这里要加上$tokenPayload['exp']

from webman-jwt.

Tinywan avatar Tinywan commented on May 23, 2024

没过期也可以刷新的,例如:学员需要考试,在考试之前需要强制刷新(访问令牌并没有过期)获取访问令牌,避免在考试过程中令牌失效

from webman-jwt.

woann avatar woann commented on May 23, 2024

我测试的结果是,假如access_token有效期是20秒,过期后,我通过refreshtoken刷新得到的新access_token有效期不是20秒,你可以测试下看看

from webman-jwt.

woann avatar woann commented on May 23, 2024

image
这样改了才正常

from webman-jwt.

Tinywan avatar Tinywan commented on May 23, 2024

不是20秒,而是 20 + 60 秒是吗?

from webman-jwt.

woann avatar woann commented on May 23, 2024

from webman-jwt.

Tinywan avatar Tinywan commented on May 23, 2024

那是因为配置项有

// 时钟偏差冗余时间,单位秒。建议这个余地应该不大于几分钟。
'leeway' => 60,

你把这个设置成 0,就可以了

from webman-jwt.

woann avatar woann commented on May 23, 2024

不是的,这个参数我测试的时候已经改为0了。

from webman-jwt.

Tinywan avatar Tinywan commented on May 23, 2024

#4 (comment) 你反馈的这个问题确实是存在的,在常驻内存框架下,令牌签发时间iat 并不是当前的时间戳,而是初始化的时间戳。之前一直是在fpm下使用,没有这个问题

from webman-jwt.

woann avatar woann commented on May 23, 2024

通过refresh_token刷新获得的新access_token,有效期貌似是access_exp + refresh_exp的总和,刚刚试了下access_token有效期设置为20秒,refresh_exp有效期为1小时,现在已经过去了接近十分钟,新的access_token一直有效

from webman-jwt.

Tinywan avatar Tinywan commented on May 23, 2024

嗯!就是令牌签发时间iat 这个问题

from webman-jwt.

woann avatar woann commented on May 23, 2024

等你搞好我再update😋

from webman-jwt.

Tinywan avatar Tinywan commented on May 23, 2024

v1.2.5 已经按照你的修复,感谢反馈

from webman-jwt.

woann avatar woann commented on May 23, 2024

ok,已更新

from webman-jwt.

Related Issues (15)

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.