2015-04-22 81 views
0

我使用以下步骤来刷新LinkedIn的oauth2访问令牌LinkedIn OAuth访问令牌刷新不增加到期时间

https://developer.linkedin.com/docs/oauth2#refresh

开始在浏览器中的OAuth程序后,如所描​​述的对话框被跳过,然后发布一个新代码,然后用它来获得一个新的,不同的access_token。但expires_in字段(秒至期满)小于前一个access_token中的那个字段,实际上它引用的是相同的截止日期。

这意味着过期日期实际上还没有被扩展,这是刷新访问令牌的目的。

刷新访问令牌是否延长到期时间?
还是有什么我在这里失踪? (也许是到期日只能使用一定时间后延长?)

回答

-1

expires_in永远是同前access_token因为expires_in只是到期令牌的有效期为数量。我不知道LinkedIn的价值回报是什么,但我猜你每次都看到一个不错的回合数?

https://tools.ietf.org/html/rfc6749#section-4.2.2

expires_in

 RECOMMENDED. The lifetime in seconds of the access token. For 
    example, the value "3600" denotes that the access token will 
    expire in one hour from the time the response was generated. 
    If omitted, the authorization server SHOULD provide the 
    expiration time via other means or document the default value. 
+0

我没有看到一个回合数,数量正在减少在随后的请求,因为它是引用相同的失效日期之前的访问令牌,如在我的问题中概述(我编辑了这个问题,使之更加清晰) –