我正在使用box API .
通过身份验证,我得到 Access Token(AT) 和 Refresh Token(RT) .
1小时后 AT 已过期 . 现在我请求服务器当前 RT
Request:-
岗位
https://api.box.com/oauth2/token
参数: -
1)grant_type
2)client_id
3)client_secret
4)referh_token
实际结果是这样的
{
access_token: new AT
referh_token: new RT
.....
.....
}
但我的结果是
{
"error":"invalid_grant",
"error_description":"Refresh token has expired"
}
请帮我 .
提前致谢
1 回答
如果刷新令牌过期,则必须通过从头开始启动OAuth登录流程来获取新的刷新令牌 .
从第2步开始:https://developer.box.com/v2.0/docs/oauth-20#section-2-the-first-leg
确保您的代码侦听来自API的“401 Unauthorized”响应,并将新的Refresh Token保存回初始化代码的任何位置 .