2014-10-01 296 views
1

我想使用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幫我解決這個問題。

感謝

+0

您是否啓用了驅動器api和驅動sdk – DaImTo 2014-10-01 18:55:55

+0

ya我已啓用驅動器api並驅動sdk – Cool 2014-10-02 02:50:02

+0

將完整的http請求和響應粘貼到您的問題中。這是一個應用程序域用戶嗎? – pinoyyid 2014-10-02 04:28:56

回答

0

你必須張貼你的開發者控制檯,而不是客戶端1d獲得的電子郵件地址,你必須授權對您的酒莊(交友)的驅動器範圍的客戶端id。

+0

我無法在Google開發者控制檯中找到任何電子郵件地址。我可以在哪裏找到電子郵件地址?如果可能,可以提供一步一步的指導。謝謝 – Cool 2014-10-02 15:51:52