Firebase: This domain is not authorized

前端 未结 9 1234
[愿得一人]
[愿得一人] 2020-12-23 14:11

I imported Firebase JS v3 API and used to initialize Firebase using:

firebase.initializeApp(config);

However the app failed to load correct

相关标签:
9条回答
  • 2020-12-23 14:23

    Solution which worked for me after trying out all the options on the listed above and on other sites regarding using FireBase oAuth was the following:

    1. login at https://console.cloud.google.com
    2. Go to APIs & Services > Credentials

    Once here, locate API Key you are using in your app that connects to FireBase

    1. Now add your custom domain to HTTP Referrers

    For android or ios or having your application on all three mediums, you will need to create API keys per medium.

    0 讨论(0)
  • 2020-12-23 14:24

    For those having this issue in Heroku:

    Make sure you keep the authDomain property with the same value you got from Firebase.

    DO NOT change this to the current Heroku domain.

    0 讨论(0)
  • 2020-12-23 14:24

    Firebase Users

    For me the source of the error was that the domain was not added in the firebase console. Here is an image in the firebase console to add the custom domain for your website:

    0 讨论(0)
  • 2020-12-23 14:26

    Make sure the "authDomain" in your config matches the one in your firebase console. If you're running the app on localhost, make sure it's set to localhost and localhost exists on your firebase console.

    Auth -> Sign In Method -> OAuth redirect domains

    var config = {
        apiKey: "...",
        authDomain: "...", // this should match the one on your firebase console
        databaseURL: "...",
        storageBucket: "",
    };
    firebase.initializeApp(config);
    
    0 讨论(0)
  • 2020-12-23 14:28

    in firebase console Auth --> Authorised domains


    must equal (in Google cloud console -- > API & Services --> credentials ) :


    must equal (in api config) :

    0 讨论(0)
  • 2020-12-23 14:28

    None of the above answers worked for me, as I already had localhost in Authorized domains list. For me the problem was incorrect API key, I must have somehow deleted one of the characters from it. I got a more descriptive (or rather - not misleading) error message when I changed to signInWithPopup to signInWithRedirect. Possibly the same problem might happen when the API key is expired.

    0 讨论(0)
提交回复
热议问题