Google Drive 身份验证问题 [英] Google Drive authentication issues

查看:21
本文介绍了Google Drive 身份验证问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Ruby 使用 Google Drive 时遇到问题.

I'm having an issue using Google Drive using Ruby.

我可以创建一个 OAuth2 客户端并开始进行经过身份验证的调用.

I can create an OAuth2 client and start making authenticated calls.

我必须先查询 Google 文档列表才能获取文件列表,一旦我有了文件 ID,我就会尝试像这样查询 Google Drive API:

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

但是我得到了这个:

{
 "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 指的是我通过 Google API Dashboard 创建的应用程序,而不是 Chrome 网上应用店.

This client id refers to an application I created via Google API Dashboard, not the Chrome Web Store.

无论如何,我尝试设置一个托管的 Chrome Web 应用程序,配置(并支付)所有内容以允许测试用户列表,但我仍然收到相同的错误消息,尽管该应用程序是从市场上正确安装的(不是本地副本).

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).

使用相同的客户端和凭据,我可以调用 https://docs.google.com/feeds/ 端点,但不是驱动端点.

With the same client and credentials I'm able to call https://docs.google.com/feeds/ endpoints but not drive ones.

我的范围相当完整:'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'(不要看格式,之后会自动修复),它们运行良好.

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.

我没有使用 Drive UI,我只想使用服务器端 API.感谢您的任何提示.

I'm not using the Drive UI, I just want to use server-side APIs. Thanks for any hints.

推荐答案

您是否在清单中设置了 "api_console_project_id" : "xxxxxxxxxxxxx" 参数?此处提供了一个示例:manifest.json

Have you set the "api_console_project_id" : "xxxxxxxxxxxxx" argument in your manifest ? An example is provided here: manifest.json

这篇关于Google Drive 身份验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆