【发布时间】:2014-10-01 17:58:46
【问题描述】:
我想使用 OAuth 2.0 for Devices 访问 Google Drive 以上传文件。所以我将范围变量设置为https://www.googleapis.com/auth/drive,并在谷歌开发者控制台上启用了api。
我的请求
POST /o/oauth2/device/code HTTP/1.1
Host: accounts.google.com
Content-Type: application/x-www-form-urlencoded
client_id=3146639059-qvroaqrtit609qaknv8anvdn2umus01q.apps.googleusercontent.com & scope=https://www.googleapis.com/auth/drive
但我得到的回应是
{
"error" : "invalid_scope",
"error_description" : "Not authorized to request the scopes: [https://www.googleapis.com/auth/drive]",
"error_uri" : "http://code.google.com/apis/accounts/docs/OAuth2.html"
}
如果我使用 email 而不是 https://www.googleapis.com/auth/drive
因为它工作正常。请帮我解决这个问题。
谢谢
【问题讨论】:
-
你启用驱动api和驱动sdk了吗
-
是的,我启用了驱动 api 和驱动 sdk
-
将完整的 http 请求和响应粘贴到您的问题中。这是应用域用户吗?
标签: google-oauth google-drive-api