Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accesstoken抢占问题 #207

Open
bbdabing opened this issue Jun 5, 2024 · 1 comment
Open

accesstoken抢占问题 #207

bbdabing opened this issue Jun 5, 2024 · 1 comment
Assignees
Labels
bug Something isn't working improvement improvement of function

Comments

@bbdabing
Copy link

bbdabing commented Jun 5, 2024

justauth抢占accesstoken问题,这里发现justauth不缓存accesstoken的,也就是每次需要都会重新获取accesstoken,那这会不会导致
第三方接口次数限制呢?比如:微信公众号的建议是accesstoken两小时内有效,有效期内部需要重复获取,获取的接口有次数限制。
另外,justauth在授权的过程中抢占accesstoken的问题咋解决,比如一个项目中,有引入一套成熟的全量接口的封装jar包,但是因为要
使用justauth,而不能兼容其他jar包如何处理,最简单的,jar包本身有获取accesstoken的逻辑并且做了缓存,但justauth又需要单独
获取,这两者之间存在抢占accesstoken的问题,导致accesstoken不停的过期重新获取。

@bbdabing bbdabing added the bug Something isn't working label Jun 5, 2024
@zhangyd-c
Copy link
Member

zhangyd-c commented Aug 3, 2024

#194

在接下来的 1.16.7 版本中,会将 getAccessTokengetUserInfo 两个接口提到 AuthRequest 中,这样业务系统可以直接调用这两个接口完成特定的业务。

针对你这个场景,业务系统使用 JustAuth 登录成功后将 AuthToken 信息缓存,当在 AuthToken 有效期内再次登录的时候,业务系统可以考虑跳过 getAccessToken 这步,直接调用 getUserInfo 获取用户信息

@zhangyd-c zhangyd-c self-assigned this Aug 3, 2024
@zhangyd-c zhangyd-c added the improvement improvement of function label Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working improvement improvement of function
Projects
None yet
Development

No branches or pull requests

2 participants