为什么我得到“经过身份验证的用户尚未安装具有客户端ID的应用程序”何时使用Google Drive API时出错? [英] Why am I getting "The authenticated user has not installed the app with client id" error when using the Google Drive API natively?

查看:255
本文介绍了为什么我得到“经过身份验证的用户尚未安装具有客户端ID的应用程序”何时使用Google Drive API时出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Emacs的Google Drive界面。这个概念是,Emacs可以提供与平台无关的方式来加载,修改和保存存储在Google云端硬盘中的文本文档。我注册了我的应用程序,可以使用OAuth2进行身份验证,并使用文档列表API获取文件列表,但是当我尝试使用Google Drive API执行插入时,我看到错误:



已验证的用户尚未安装具有客户端ID的应用程序...



进一步阅读,似乎我需要发布我的Emacs应用程序Chrome网上应用店可以访问Drive API。这对我来说没有意义...我注意到有一个针对Google Drive的FUSE项目正在开发中,这表明本地开发是可行的。当我撇去代码时,我没有看到Chrome网上应用店组件可以正常工作。



我试图滥用API,还是有路线使这项工作更有意义?

解决方案

编辑:



据Google Drive团队的Ali Afshar介绍,安装不再需要使用此API。那么下面的内容可能不再是相关的,但将会被用于历史目的。






不支持应用程序开发的意义上,我们都在这样做,我不会使用这个词本机。好消息是我一直在做一些研究,Google Drive真的只是Google文档的重塑。因此,Google Docs API可能是一个很好的选择,同样的目的。



无论如何,以下是解决错误的步骤:经过身份验证的用户尚未安装应用程序与客户端id ...这是一个403错误,为了这个答案。 这些步骤假设您已经根据需要在chrome网上商店中设置了一个应用程序,并将其安装。我正在使用我的本地机器工作: http://github.com/tom-dignan/gdrive-cli 我已经经历了这个错误,所以我认为你应该继续堵塞你的emacs版本,因为我认为我们可以使这项工作。



a。打开 Google API控制台



湾确认您已经在API访问下启用了apis,应启用Google驱动器的API和SDK。在那里你得到你的客户端秘密/ api密钥等。我几乎是积极的,你已经做到了这一点,所以去C.(这是为别的谁可能错过了)



c。在左侧导航栏中的驱动器SDK下,您需要执行以下操作:


  1. 添加支持URL (必填)


  2. 至少添加一个小的16x16应用程序图标(必需)


  3. 在云端硬盘集成下添加OAuth客户端ID(必需)(我只是修补,这似乎是关键字段。)


  4. 添加打开网址(必填)从​​Google驱动器用户界面为您的应用打开的网址。


  5. 检查多文件支持


  6. 添加一些MIME类型和文件扩展名,text / plain和txt例如


  7. 添加验证范围:



    https://www.googleapis.com/auth/userinfo.email



    https://www.googleapis.com/auth/ userinfo.profile


请勿尝试在此添加Google文档的授权范围,因为它不行。 Google不希望我们这样使用,因为驱动应用创建的文件应该是该应用的私有的。与Google文档的整合必须是分开的。



现在我知道你一定在想为什么要添加其中的一些...这是因为表单使他们需要领域。在我的地方,我把几个网址指向静态HTML页面。



完成上述操作后,请清理您的状态并重新安装Chrome应用程序。然后再次尝试你的代码,它应该停止给你一个403。


I'm working on a Google Drive interface for Emacs. The concept is that Emacs could provide a platform-agnostic way to load, modify and save text documents stored in Google Drive. I've registered my app and can authenticate with OAuth2 and get a file listing with the Docs List API, but when I try to execute an Insert with the Google Drive API, I see an error:

"The authenticated user has not installed the app with client id ..."

Reading further, it seems I need to publish my Emacs application in the Chrome Web Store to get access to the Drive API. That doesn't make sense to me...I noticed that there is a FUSE project in development for Google Drive, which suggests that native development is possible. When I skimmed the code, however, I didn't see a Chrome Web Store component to getting it working.

Am I trying to misuse the API, or is there an route to make this work that makes more sense?

解决方案

EDIT:

According to Ali Afshar, of the Google Drive team, installation is no longer required to use this API. So what follows may no longer be relevant, but will be left for historical purposes.


So, first off the API does not support application development in the sense that we are both doing it, I wouldn't use the word native though. The good news is I have been doing some research and Google Drive is really just a rebranding of Google Docs. So the Google Docs API could be a good choice as well for the same purposes.

Anyway, here's the steps to solve the error: "The authenticated user has not installed the app with client id ..." Which is a 403 error, for the sake of this answer. These steps assume you have set up an app in the chrome web store as is required, and installed it. I am working on my local machine too, with my project: http://github.com/tom-dignan/gdrive-cli which I have gotten past this error, so I think you should keep plugging away at your emacs version, because I think we can make this work.

a. Open the Google APIs console.

b. Confirm you've already enabled the apis under "API Access" both the API and SDK for Google drive should be enabled. There you get your client secrets/api keys and such. I am almost positive you've done this already, so go ahead to C. (this is here for others who may have missed it)

c. In the left navigation bar, under "Drive SDK" you will need to do the following:

  1. Add a "Support URL" (required)

  2. Add at least a small 16x16 application icon (required)

  3. Add "OAuth Client ID (Required)" under Drive Integration (I was just tinkering and this seems to be the key field.)

  4. Add "Open URL (Required) URL to open for your app from the google drive UI."

  5. Check off "Multiple File Support"

  6. Add some MIME types and file extensions, "text/plain", and txt for example

  7. Add the the auth scopes:

    https://www.googleapis.com/auth/userinfo.email

    https://www.googleapis.com/auth/userinfo.profile

Don't bother trying to add the auth scopes for Google Docs here, because it won't work. Google does not want us to use it that way because files that drive apps create should be private to that app. Integration with Google Docs will have to be separate.

Now I know you must be thinking "why do I have to add some of these..." It's because the form makes them required fields. In mine, I put a couple URLs that point to static HTML pages.

Once you've done the above, clean up your state and reinstall your chrome app. Then try your code again, and it should stop giving you a 403.

这篇关于为什么我得到“经过身份验证的用户尚未安装具有客户端ID的应用程序”何时使用Google Drive API时出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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