Firebase: This domain is not authorized

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

firebase.initializeApp(config);

However the app failed to load correctly via web browser on localhost, resulting in the following error:

Error: This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.

firebase.js:71:1333


I solved the problem by adding the localhost domain to OAuth redirect domains (within SETUP SIGN IN METHOD on the Auth tab of Firebase console).


in firebase console Auth --> Authorised domains

enter image description here


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

enter image description here


must equal (in api config) :

enter image description here


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

enter image description here

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

  1. Now add your custom domain to HTTP Referrers

enter image description here

enter image description here

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