Google云端硬盘帮助您访问自己的云端硬盘帐户 [英] Google Drive help required access to own Drive account

查看:205
本文介绍了Google云端硬盘帮助您访问自己的云端硬盘帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在网页上访问我自己的谷歌浏览器,但允许任何人上传文件并限制下载访问权限,或者只显示有限的文件供用户下载。



云端硬盘API假定我将访问另一个用户凭据。
但我想要的是相反的,任何人都可以查看我的文件(限制要查看的内容),但可以自由上传。
我的谷歌接近6个小时以上,并没有找到任何解决方案



任何帮助赞赏
谢谢


<解决方案 你说驱动器API假定我将访问另一个用户凭据,但这是不正确的。呼叫驱动器包含一个访问令牌,并且它确定该呼叫将访问哪个云端硬盘帐户。 Drive并没有假设该访问令牌是如何获得的或者它引用了哪个帐户。

所有示例都显示了如何为最终用户获取Access Token,因为这是更复杂的流程。您的要求非常简单。



您需要做的是: -
$ b $ ol <

  • 获取刷新令牌(请参阅如何在没有用户干预的情况下授权应用程序(Web或安装)?(canonical?)

  • 将刷新令牌存储在您的PHP应用程序中。确保安全

  • 当您需要访问您的云端硬盘帐户时,请使用刷新令牌获取访问令牌,如 https://developers.google.com/accounts/docs/OAuth2WebServer#refresh


  • I want to access my own google drive on web page but allow anyone to upload files and restrict download access or show only limited file to user for downloading.

    Drive API assumes that I will access another users credentials. But what I want is opposite, anyone can view my files (restricted what to view) but is free to upload. I have google nearly 6+ hours and didn't found any solution

    Any Help Appreciated Thanks

    解决方案

    You say "Drive API assumes that I will access another users credentials" but this isn't correct. Calls to Drive include an Access Token, and it is that which determines which Drive account the call will access. Drive makes no assumptions about how that Access Token was obtained or which account it refers to.

    All of the examples show how an Access Token is obtained for an end user, since that is the more complex flow. Your requirement is very much simpler.

    All you need to do is:-

    1. Obtain a refresh token (see How do I authorise an app (web or installed) without user intervention? (canonical ?))
    2. Store that refresh token in your PHP application. Make sure it's secure
    3. When you need to access your Drive account, use the refresh token to obtain an access token as described at https://developers.google.com/accounts/docs/OAuth2WebServer#refresh

    这篇关于Google云端硬盘帮助您访问自己的云端硬盘帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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