Google Drive身份验证问题 [英] Google Drive authentication issues
问题描述
为了获取文件列表,我必须先查询Google文档列表,一旦我有文件ID,我尝试像这样查询Google Drive API:
GET https://www.googleapis.com/drive/v1/files/0B9N873iFyYR7MkRfeTAxxxxxxx?access_token=ya29.AHES6ZRckKZ2jZfC6risUtH9ZZxxxxxxxxx
然而,我得到这个:
{
错误:{
errors:[
{
domain:global,
reason:appNotInstalled,
message:经过身份验证的用户未安装客户端ID为xxxxx.apps.googleusercontent.com的应用程序
}
],
code:403,
message:经过身份验证的用户未安装客户端ID为xxxxx.apps.googleusercontent.com的应用程序
}
}
T他的客户端ID是指我通过Google 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。感谢您的任何提示。 解决方案
你在清单中设置了api_console_project_id:xxxxxxxxxxxxx
此处提供了一个示例: manifest.json
I'm having an issue using Google Drive using Ruby.
I can create an OAuth2 client and start making authenticated calls.
I have to query the Google Documents List first in order to fetch a list of files, once I have the file IDs I try to query the Google Drive API like this:
GET https://www.googleapis.com/drive/v1/files/0B9N873iFyYR7MkRfeTAxxxxxxx?access_token=ya29.AHES6ZRckKZ2jZfC6risUtH9ZZxxxxxxxxx
However I'm getting this:
{
"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"
}
}
This client id refers to an application I created via Google API Dashboard, not the Chrome Web Store.
Anyway I tried to setup a hosted Chrome Web App, configured (and paid) everything to allow a list of test users, but still I get the same error message although the app is installed correctly from the market (not local copy).
With the same client and credentials I'm able to call https://docs.google.com/feeds/ endpoints but not drive ones.
My scopes are rather complete: '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'
(don't look at the format, it gets fixed automatically afterwards) and they works well.
I'm not using the Drive UI, I just want to use server-side APIs. Thanks for any hints.
Have you set the "api_console_project_id" : "xxxxxxxxxxxxx" argument in your manifest ? An example is provided here: manifest.json
这篇关于Google Drive身份验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!