【问题标题】:Google Drive API scope : why I only have access to one?Google Drive API 范围:为什么我只能访问一个?
【发布时间】:2019-11-12 21:02:02
【问题描述】:

这可能是一个简单(愚蠢)的问题,但在这一点上,我就是不明白。

我可以通过以下方式连接到范围 drive.file

curl -d 'client_id='$idclient'' -d 'scope=https://www.googleapis.com/auth/drive.file' -d 'response_type=code' 'https://accounts.google.com/o/oauth2/device/code'

但是,当我想连接到范围 file 时,我得到 "error": "invalid_scope" 结果。

但正如我们在此屏幕截图中看到的,此范围已在 Google OAuth 页面中的我的应用程序中启用: Scope permission in my account

那么,如何连接到范围https://www.googleapis.com/auth/drive

谢谢

【问题讨论】:

    标签: curl google-drive-api


    【解决方案1】:

    我想您正在使用“Oauth 2.0 for TV and Limited-Input Device Applications”。正如您在documentation 顶部的“注释”中看到的那样:

    重要提示:此 OAuth 2.0 流程支持一组有限的范围。

    它将我们带到“允许的范围”section,关于 Drive API(此处为 Drive File API),我们只有这个范围可用:

    https://www.googleapis.com/auth/drive.file

    【讨论】:

      【解决方案2】:

      显然,我想使用的 API 是“受限”的: OAuth 2.0 scope information for the Drive API

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-09-04
        • 1970-01-01
        • 1970-01-01
        • 2015-05-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-10-06
        相关资源
        最近更新 更多