我想使用OAuth 2.0 for Devices上傳文件來訪問Google Drive。因此,我將範圍變量設置爲https://www.googleapis.com/auth/drive
,並在Google開發者控制檯上啓用了apis。Google Oauth 2.0範圍問題
我的要求
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"
}
相反的https://www.googleapis.com/auth/drive
如果我使用email
的範圍及其工作fine.Please幫我解決這個問題。
感謝
您是否啓用了驅動器api和驅動sdk – DaImTo 2014-10-01 18:55:55
ya我已啓用驅動器api並驅動sdk – Cool 2014-10-02 02:50:02
將完整的http請求和響應粘貼到您的問題中。這是一個應用程序域用戶嗎? – pinoyyid 2014-10-02 04:28:56