2012-04-30 80 views
114

当我从Google API获得access_token时,它的值为expires_in。根据文档,该值指示“访问令牌的剩余生命周期”。Google访问令牌到期时间

该值的单位是什么?

+8

因为有99.9%的时间,当你有一个数字表示时间是秒或细分,而毫秒/毫秒对这种情况没有意义吗? – Venge

+6

@FrankLaRosa:有什么方法可以将访问令牌的过期设置为无限制。 – hardik

+1

请接受下面的答案,如果这是令人满意的,谢谢 – msysmilu

回答

64

细则中指出秒:

http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-4.2.2

expires_in 
    OPTIONAL. 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. 

我与OP,这为谷歌并不会记录这个粗心的同意。

+0

这是正确的答案 – YYamil

11

,因为没有公认的答案我会尽量回答这个问题:

[s] - seconds