2012-04-30 57 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