-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
authorizer_refresh_token刷新问题 #1033
Comments
你确定刷新 |
我刚刚也试过了,authorizer_refresh_token确实是不会变的。能否开放一个接口让开发者获取缓存里的authorizer_refresh_token,因为真实场景通常是在后台授权成功以后,在前台再去调用$app->createAuthorizerApplication($authorizerAppid, $authorizerRefreshToken)来处理业务 |
这个方法可以获取到已授权的列表: |
谢谢!非常棒! |
补充一下,$app->getAuthorizerList()是从微信接口获取的信息,跟mingyoung讨论过,确认了开发者自己要存一份authorizer_refresh_token到数据库来维护 |
不清楚为何authorizer_refresh_token不设计为自动缓存.access_token这些都缓存了. |
那请问如果缓存过期了呢?再叫客户授权一次? |
理解了,你的意思是如果自动缓存,而缓存被清理后会丢失refresh_token,所以设计的时候希望开发者自行妥善保存refresh_token. |
我仍有不理解的地方是: |
P.S. 如果有更好设计欢迎指出~ |
好的,理解了. |
我用的环境
PHP 版本:php7.1
overtrue/wechat 版本:3.1
是否使用了框架?框架名称:Yii2
问题及现象
开放平台的authorizer_refresh_token要随着authorizer_access_token一起刷新,微信文档如下:
https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1453779503&token=&lang=zh_CN
5、获取(刷新)授权公众号或小程序的接口调用凭据(令牌)
个人解决方案
overtrue\wechat\src\OpenPlatform\AuthorizerAccessToken.php 第95行开始添加代码
$this->authorizer->setRefreshToken($token['authorizer_refresh_token']);
The text was updated successfully, but these errors were encountered: