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
must equal (in Google cloud console -- > API & Services --> credentials ) :
must equal (in api config) :
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:
- login at https://console.cloud.google.com
- Go to APIs & Services > Credentials
Once here, locate API Key you are using in your app that connects to FireBase
- 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.