【问题标题】:Is the https://www.googleapis.com/auth/drive.file enough to create and update files or is the scope /drive needed?https://www.googleapis.com/auth/drive.file 是否足以创建和更新文件,或者是否需要范围 /drive?
【发布时间】:2019-05-28 14:23:03
【问题描述】:

目前我们只有https://www.googleapis.com/auth/drive.readonly 范围,但我们也希望能够将文件写入和更新到谷歌驱动器。阅读他们声明https://www.googleapis.com/auth/drive.file 足以创建和更新文件的文档。但在我们申请这个之前,我想确保这个范围是足够的。

【问题讨论】:

    标签: google-drive-api


    【解决方案1】:

    如文档中所述,https://www.googleapis.com/auth/drive.file 仅允许您访问由应用程序(您)创建或打开的文件。

    https://www.googleapis.com/auth/drive 允许您访问用户的所有文件,不包括 Application Data 文件夹。

    因此,如果您想访问所有用户文件 https://www.googleapis.com/auth/drive 否则 https://www.googleapis.com/auth/drive.file 足以创建和更新文件。

    【讨论】:

    • 你好,我不太清楚如何定义这个“打开”。如果用户在 GoogleDrive 网页上创建了一个文档,有没有办法先在我的应用上打开它,然后只使用 https://www.googleapis.com/auth/drive.file 更改权限?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-24
    • 2013-10-11
    • 2010-10-23
    相关资源
    最近更新 更多