2014-03-25 78 views
4

我正在使用gem omniauth-google-oauth2從Google Rails應用登錄。 這些天我得到這個錯誤:Google Oauth使用omniauth-google-oauth2登錄頻繁失敗

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "usageLimits", 
    "reason": "accessNotConfigured", 
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." 
    } 
    ], 
    "code": 403, 
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." 
} 
} 

相同的設置將工作的優良本地主機,但常常失敗,在生產的某個時候工作。我不知道發生了什麼事? Google最近是否在更改API?我需要啓用哪些API才能登錄並獲取用戶信息?

回答

2

20小時前我們開始遇到相同的問題,但它出現在生產和本地主機(使用兩個獨立的Google帳戶)上。奇怪的是我們能夠每3到4次嘗試一次,但不是每次都能登錄。

至於谷歌的最終的API的變化,對omniauth - 谷歌 - 這的oauth2問題似乎相關:https://github.com/zquestz/omniauth-google-oauth2/issues/106。然而,這種折舊不應該強制執行,直至九月,2014年

此外,直接編輯omniauth - 谷歌 - 的oauth2寶石和改變這些行:

class GoogleOauth2 < OmniAuth::Strategies::OAuth2 
    BASE_SCOPE_URL = "https://www.googleapis.com/auth/" 
    DEFAULT_SCOPE = "userinfo.email,userinfo.profile" 

這樣:

class GoogleOauth2 < OmniAuth::Strategies::OAuth2 
    BASE_SCOPE_URL = "https://www.googleapis.com/auth/" 
    DEFAULT_SCOPE = "email,profile" 

產生了此錯誤:

錯誤:invalid_scope 某些請求的作用域無效。 {無效= [https://www.googleapis.com/auth/profile,https://www.googleapis.com/auth/email]}

更新: 從電子郵件引用從杆(hire.lever.co):

「的問題源於谷歌對昨晚使用的用於識別用戶的身份驗證系統的一個版本中的一個錯誤,我們之間的應用程序失去了通過Google OAuth API驗證用戶的能力,我們一直在與Google進行溝通,我們被告知該發佈在PDT上午11:30恢復。「

Google OAuth現在似乎已經修好了。

1

我們發現我們的某個項目已啓用結算功能,但未輸入結算信息。爲此特定項目禁用帳單似乎已爲我們解決了此問題。

我們得到的錯誤是:

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "usageLimits", 
    "reason": "accessNotConfigured", 
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." 
    } 
    ], 
    "code": 403, 
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." 
} 
} 

更新:當然,我們的補丁應用於〜11:30 AM PDT,所以我我投票,這是谷歌的問題。

4

從omniauth-google-oauth2 0.2.2更新到0.2.4時遇到此問題。要解決該問題,請轉至您的Google Developers Console。點擊「API」並啓用「聯繫人API」和「Google+ API」。這GitHub issue更詳細地描述了這個問題。

+0

我不必添加通訊錄API – adamwong246