登录使用Facebook和火力地堡上的Web应用程序

问题描述:

我想通过火力地堡使用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

见我的答案:) –

假设您已注册您的应用程序与Facebook,你需要添加你的Facebook应用程序ID和秘密火力地堡,然后注册的OAuth与Facebook重定向。

Sign-in Providers

+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." 
} 
}