0

我想通過火力地堡使用Facebook登錄這樣的:登錄使用Facebook和火力地堡上的Web應用程序

firebase.auth().signInWithPopup(provider).then(function(result) { 
    // This gives you a Facebook Access Token. You can use it to access the Facebook API. 

}).catch(function(error) { 
    // Handle Errors here. 

}); 

但我還是有些麻煩的「授權」。在這裏我的控制檯錯誤:

enter image description here

我試圖檢查 「驗證部分 - >登錄」,在火力地堡,這裏的圖片:

enter image description here

但是,不幸的是,沒有幫助我。所以,我檢查了谷歌API控制檯,這裏的關鍵是:

enter image description here

當我打電話signInWithPopup功能出現JavaScript錯誤。

有人可以幫我嗎?謝謝。

+0

什麼域,您在服務應用程序? –

+0

我想你的瀏覽器ApiKey可能有問題。可能存在推薦人限制。我注意到,因爲你的請求中有403個。你能向我們展示getProjectConfig請求的響應嗎? – bojeil

+0

見我的答案:) –

回答

0

假設您已註冊您的應用程序與Facebook,你需要添加你的Facebook應用程序ID和祕密火力地堡,然後註冊的OAuth與Facebook重定向。

Sign-in Providers

+0

謝謝!已完成但尚未運作... –

0

當然@bojeil中,這是 「getProjectConfig」 請求的響應。

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "usageLimits", 
    "reason": "ipRefererBlocked", 
    "message": "The referrer https://mywebsite-28961.firebaseapp.com/__/auth/iframe?apiKey=AIzaSXXXXXXXXXXXJxJtYyQc&appName=%5BDEFAULT%5D&v=3.2.1&usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.fr.rHHEwUgDOpI.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCM__323woIJL0YGmPpXSAOboj0rkQ does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions.", 
    "extendedHelp": "https://console.developers.google.com/apis/credentials?project=952309991745" 
    } 
    ], 
    "code": 403, 
    "message": "The referrer https://mywebsite-28961.firebaseapp.com/__/auth/iframe?apiKey=AIzaSXXXXXXXXXXXJxJtYyQc&appName=%5BDEFAULT%5D&v=3.2.1&usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.fr.rHHEwUgDOpI.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCM__323woIJL0YGmPpXSAOboj0rkQ does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions." 
} 
}