在没有 OAuth2 的情况下访问 Google Drive [英] Access Google Drive without OAuth2

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

问题描述

我一直在翻阅有关 GoogleDrive SDK 和 Drive API 的所有 Google 文档,但是我无法确定是否有一种方法可以在不使用 OAuth2 的情况下连接到特定的 GoogleDrive.

I have been rummaging through all the Google documentation on GoogleDrive SDK and the Drive API, however I cannot find out if there is a way to connect to a particular GoogleDrive without having to use OAuth2.

我意识到 OAuth2 允许服务器或客户端能够安全地连接到相关的特定 Google Drive.但是,我想知道是否有一种方法可以简单地为 Google Drive 实例提供一个 API 密钥,并通过它访问我的文件和文件夹.事实上,我已经有一种方法可以使用 OAuth2 连接到用户的 Google Drive,但我只想以这种方式连接到我的,以便自动将统计数据推送到我自己的 Google Drive 上的表单中.由于它是自动化的,我不想填写凭证表格并单击接受"等等,当然我意识到在那之后我可以拥有一个刷新令牌.但我真的很想尽可能避免这一切.

I realize that OAuth2 allows for the server or client to be able to connect securely to the particular Google Drive in question. However, I want to know if there is a way to simply have an API Key for the Google Drive instance and simply through that, access my files and folders. In fact I have a way to connect to the user's Google Drive already with OAuth2, but I want to only connect to mine in this way in order to automate pushing off statistical data to forms on my own Google Drive. Since it's automated I don't want to have to fill in the credential form and click "Accept" and all that, of course I realize that after that I'd be able to have a refresh token. But I really want to avoid all that if possible.

这与 Mashery 允许的许多 API 以及 Twilio 具有相似的功能.只有 API Key 才能访问.

This is similar functionality to much of the APIs that Mashery allows, as well as Twilio. Only the API Key and then you can have access.

我真的只需要知道这是否可能,所以我可以继续追求或放弃它并尝试不同的东西.

I really just need to know if this is at all possible or not, so I can either continue with the pursuit or leave it and try something different.

推荐答案

如果有办法连接到特定的 GoogleDrive 而无需使用 OAuth2."

没有.Oauth2 是唯一支持的授权/身份验证机制.

No. Oauth2 is the only authorization/authentication mechanism supported.

如果您的问题真的是是否有办法连接到特定的 GoogleDrive 而无需编写 OAuth2 代码."那么这个答案可能会有所帮助 如何在没有用户干预的情况下授权应用程序(网络或安装)?(规范?)

If you're question is really "if there is a way to connect to a particular GoogleDrive without having to write OAuth2 code.", then this answer might help How do I authorise an app (web or installed) without user intervention? (canonical ?)

只有 API 密钥,然后您才能访问."听起来有点像 Google 服务帐户,但这会为该应用创建一个伪云端硬盘帐户,而不是让该应用访问您的常规云端硬盘帐户.

The "Only the API Key and then you can have access." sounds a bit like a Google Service Account, but that would create a pseudo Drive account for the app, rather than allow the app to access your regular Drive account.

这篇关于在没有 OAuth2 的情况下访问 Google Drive的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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