2012-04-28 104 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