如何对Google Drive API进行身份验证? [英] How to authenticate as myself for Google Drive API?

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

问题描述

我还没有找到满意的答案/教程,但我确信它必须在那里。我的目标是使用我的凭据以编程方式访问Google Drive。次要和较低优先级的目标是正确执行此操作,这意味着使用OAuth而不是ClientLogin。



因此:您如何使用自己的Google Drive API进行身份验证您的Google Drive的凭据(无需在Google Developers Console上创建应用程序)?

所有文档都假设有一个应用程序,但我写的仅仅是帮助器为了我自己的利益,Python 2.7中的脚本。 您自己的Google云端硬盘凭据(无需在Google Developers Console上创建应用程序)?



您不能。 OAuth的前提是用户准许访问应用程序,因此应用程序必须注册。在Google的情况下,这就是API /云控制台。

在你的情况下,不需要注册每个使用助手脚本的应用程序。只需创建一个名为helper_scripts的应用程序,将客户端ID嵌入脚本源中,然后在任意多个应用程序中重复使用这些脚本。


I have not found a satisfactory answer/tutorial for this, but I'm sure it must be out there. My goal is to access Google Drive programmatically using my credentials. A secondary and lower-priority goal is to do this properly and that means using OAuth rather than ClientLogin.

Thus: How do you authenticate with the Google Drive API using your own credentials for your own Google Drive (without creating an application on the Google Developers Console)?

All of the documentation assumes an application, but what I'm writing is merely helper scripts in Python 2.7 for my own benefit.

解决方案

"How do you authenticate with the Google Drive API using your own credentials for your own Google Drive (without creating an application on the Google Developers Console)?"

You can't. The premise of OAuth is that the user is granting access to the application, and so the application must be registered. In Google's case, that's the API/Cloud Console.

In your case, there is no need to register each application that uses your helper scripts. Just create an app called helper_scripts, embed the client Id in your script source, and then reuse those scripts in as many applications as you like.

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

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