2012-04-28 108 views
3

我在使用Ruby使用Google雲端硬盤時遇到問題。Google雲端硬盤身份驗證問題

我可以創建一個OAuth2客戶端並開始進行認證調用。

我得先查詢谷歌文檔列表,以獲取文件列表,一旦我有文件ID我嘗試查詢谷歌雲端硬盤API這樣的:

GET https://www.googleapis.com/drive/v1/files/0B9N873iFyYR7MkRfeTAxxxxxxx?access_token=ya29.AHES6ZRckKZ2jZfC6risUtH9ZZxxxxxxxxx 

不過我得到這個:

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "appNotInstalled", 
    "message": "The authenticated user has not installed the app with client id xxxxx.apps.googleusercontent.com" 
    } 
    ], 
    "code": 403, 
    "message": "The authenticated user has not installed the app with client id xxxxx.apps.googleusercontent.com" 
} 
} 

此客戶端ID是指我通過谷歌API儀表板而不是Chrome網上應用店創建的應用程序。

無論如何,我試圖設置一個託管的Chrome Web應用程序,配置(和支付)一切,以允許測試用戶列表,但我仍然得到相同的錯誤消息,雖然該應用程序從市場上正確安裝(不是本地複製)。

使用相同的客戶端和憑據,我可以調用https://docs.google.com/feeds/端點但不驅動端點。

我的示波器比較完整:'https://docs.google.com/feeds/,https://docs.googleusercontent.com/,https://spreadsheets.google.com/feeds/,http://gdata.youtube.com,plus.me,drive.file,userinfo.email,userinfo.profile'(不要看格式,之後會自動修復),它們運行良好。

我沒有使用Drive UI,我只是想使用服務器端API。感謝任何提示。

+0

我可能已經錯過了一個步驟:http://stackoverflow.com/questions/10345904/why-am-i-getting-the-authenticated-user-has-not-installed-應用程序與客戶端我 – kain 2012-04-28 11:09:11

+0

所有的程序,但錯誤仍然是一樣的。 – kain 2012-04-28 11:22:26

回答

5

您是否在清單中設置了「api_console_project_id」:「xxxxxxxxxxxxx」參數? 一個例子在這裏提供:manifest.json

+0

哇,它的工作。其實我設置 ''' 「容器」: 「GOOGLE_DRIVE」, 「api_console_project_id」: 「101xxxxxx」, ''' ,現在我得到了另一個錯誤(403)。我完全被封鎖,因爲我知道用戶必須給應用程序訪問該文件的明確權限:\ – kain 2012-04-28 11:31:04

+0

403錯誤可能是這裏的一個 - http://stackoverflow.com/questions/10368678/google-drive- HTTP-403存取未配置誤差與 - dredit – David 2012-04-29 08:13:28