Google云端硬盘实时API OAuth2刷新错误(第3部分)

时间:2013-10-16 22:37:58

标签: google-api google-drive-api google-oauth google-drive-realtime-api

在笔记本电脑/手机从睡眠/待机状态恢复后,我正在解决实时API重新连接问题。 API正确检测到它需要刷新OAuth令牌并引发错误,但是一旦刷新了令牌,实时API就无法正确地重新连接到远程服务。这有点类似于(Part 2),但这仅在连接丢失几个小时后才会发生。

我希望在刷新OAuth令牌之后,实时API会将其拾取并与远程服务器重新同步。相反,实时API似乎认为它处于有效状态并在本地进行修改,但不会与远程服务器重新同步。

// Valid Auth Token
Object {state: "", access_token: "ya29.AHES6ZS38RR9kVX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", token_type: "Bearer", expires_in: "3600", client_id: "XXXXXXXXXXXXXXX.apps.googleusercontent.com"…}
_aa: "1"
access_token: "ya29.AHES6ZS38RR9kVX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
client_id: "XXXXXXXXXXXXXXX.apps.googleusercontent.com"
cookie_policy: undefined
expires_at: "1381916402"
expires_in: "3600"
g_user_cookie_policy: undefined
issued_at: "1381912802"
response_type: "token"
scope: Array[3]
state: ""
token_type: "Bearer"

// Current Time
Date.now()
1381912845180 [Wed Oct 16 2013 01:40:45 GMT-0700 (Pacific Daylight Time)]

// <<Computer Sleep For Hours>>
Uncaught Error: Authentication error: No token set api:462

Drive Realtime API Error: token_refresh_required: The OAuth token must be refreshed. api:464
Doc Load Error:  Rw {type: "token_refresh_required", message: "The OAuth token must be refreshed.", b: false, isFatal: false} 

// <<Refresh OAuth Token>>

// Current Time
Date.now()
1381959164975 [Wed Oct 16 2013 14:32:44 GMT-0700 (Pacific Daylight Time)]

// Valid Auth Token
Object {state: "", access_token: "ya29.AHES6ZRkwocCBwxj_h7Zx2_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", token_type: "Bearer", expires_in: "3600", client_id: "XXXXXXXXXXXXXXX.apps.googleusercontent.com"…}
_aa: "1"
access_token: "ya29.AHES6ZRkwocCBwxj_h7Zx2_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
client_id: "XXXXXXXXXXXXXXX.apps.googleusercontent.com"
cookie_policy: undefined
expires_at: "1381962143"
expires_in: "3600"
g_user_cookie_policy: undefined
issued_at: "1381958543"
response_type: "token"
scope: Array[3]
state: ""
token_type: "Bearer"

// Current Value
LOCAL.data.get("t")
"0.502 Beta 3:"

// Editing Value
LOCAL.data.set("t", "0.502 Beta 4:")
Mm {a: ""0.502 Beta 3:"", Ma: Object, K: function, oa: function, J: function…}

// Edit "Worked"
LOCAL.data.get("t")
"0.502 Beta 4:"

// <<Refresh Page>>

// Current Value
LOCAL.data.get("t")
"0.502 Beta 3:"

在OAuth刷新后对实时模型进行编辑,但编辑不会持续存在。这是API支持的有效方案吗?我是否可以提供任何其他信息,以便更容易识别问题?

0 个答案:

没有答案