2016-08-29 56 views
0

我正在從Firebase 2和AngularFire 1遷移到Firebase 3和AngularFire 2.藉助Firebase 2和AngularFire 1,我擁有所有六種身份驗證選項:Google,Facebook,Twitter,Github,電子郵件&密碼,並匿名。現在Firebase 3和AngularFire 2可以使用五種認證選項,但Google OAuth拒絕使用。我正在使用$scope.authObj.$signInWithPopup("google")。彈出彈出,但隨後有一個錯誤信息:Firebase Google OAuth重定向錯誤

The redirect URI in the request, https://crudiest-firebase.firebaseapp.com/__/auth/handler, does not match the ones authorized for the OAuth client.

在我的谷歌開發者控制檯我已授權的重定向URI設置爲https://crudiest-firebase.firebaseapp.com/__/auth/handler。這是適用於Facebook,Twitter和GitHub的URI,它與錯誤消息中的URI相同。

此錯誤消息已持續數天。

只是爲了方便比較:

https://crudiest-firebase.firebaseapp.com/__/auth/handler // rejected redirect URI https://crudiest-firebase.firebaseapp.com/__/auth/handler // redirect URI in console

任何建議,爲什麼谷歌是給我這個問題?

+1

有時,需要幾分鐘才能應用更改,請確保爲您的oauth 2.0憑證添加了授權的Javascript起源和授權重定向URI。確保你使用的是同一個項目。 – bojeil

回答

0

Google的錯誤消息包含項目ID。 Google Developers Console爲每個項目都有一個項目ID。這兩個項目ID不匹配。當您在Google Developers Console中創建項目時,您會看到一個「客戶端ID」和一個「客戶端密鑰」。然後,您可以在Firebase控制檯中輸入或更改這些內容,方法是選擇您的項目,然後在左欄中選擇「Auth」,然後選擇「Sign-in Method」標籤,然後選擇「Google」,然後單擊箭頭打開「 Web SDK配置(可選)「。然後,您可以更改「Web客戶端ID」和「Web客戶端祕密」。