2014-03-01 90 views
0

在谷歌adwords中,不推薦使用ClienLogin方法。我需要切換到OAuth2驗證方法訪問令牌時拒絕oauth2請求的訪問

我的示例代碼如下,

:method: OAUTH2_JWT 
    :user_agent: test 
    :developer_token: "*********" 
    :oauth2_issuer: "*********@developer.gserviceaccount.com" 
    :oauth2_secret: notasecret 
    :oauth2_keyfile: '*********-privatekey.p12' 
    :client_id: *********.googleusercontent.com 
    :oauth2_prn: *********@developer.gserviceaccount.com 
    :client_customer_id: ********* 

當我運行的要求,我得到如下錯誤

Authorization failed. Server message: (Signet::AuthorizationError) 
    { 
    "error" : "access_denied", 
    "error_description" : "Requested scopes not allowed:   https://adwords.google.com/api/adwords/" 
    } 

誰能告訴我解決獲取訪問令牌。

回答

0

OAuth2 + Google服務帳戶意味着您擁有Google Apps域(例如您使用GMail企業)。

,我建議你看Adwords API workshop on OAuth2

OAuth2 playground是用於測試目的也是有幫助的,你嘗試使用它直接從您的應用程序之前。

+1

我認爲帶有服務帳戶的Oauth2目前還沒有完全被adwords api支持。嘗試使用[已安裝的應用程序](https://developers.google.com/accounts/docs/OAuth2InstalledApp) – karan

+0

@karan我明白了。是的,那是有道理的。 – Agis