skip to Main Content

I’d like to use Facebook login through Firebase like this:

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.

});

But I have still some trouble with an “authorization”. Here my console error:

enter image description here

I tried to check “Auth section -> Sign in” in Firebase, here’s the picture:

enter image description here

But that, unfortunately, did not help me. So I checked the Google API console, here’s the key:

enter image description here

The Javascript error appears when I call signInWithPopup function.

Can somebody help me? Thanks.

2

Answers


  1. Chosen as BEST ANSWER

    Of course @bojeil, this is the response of "getProjectConfig" request.

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

  2. Assuming that you’ve already registered your application with Facebook, you need to add your Facebook application id and secret in Firebase and then register the OAuth redirect with Facebook.

    Sign-in Providers

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search