firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Ability to whitelist domains for Firebase Auth to work

Open andrewhamili opened this issue 3 years ago • 6 comments

I want to deploy my website using firebase Auth Emulator. It actually works not, however, the other auth methods will not work because the domain we are using is not whitelisted. Is there any way to whitelist domain to Firebase Auth Emulator?

andrewhamili avatar Jul 27 '22 22:07 andrewhamili

Hey @andrewhamili! Could you provide more context to the issue you're running into by filing a support issue here: https://firebase.google.com/support/troubleshooter/contact? As it stands, we don't have enough information to help troubleshoot the issue. Thanks!

lisajian avatar Aug 02 '22 23:08 lisajian

image

Here is the screenshot of what we are experiencing while using Firebase Auth emulator.

Based on the error log. the domain/URL should be whitelisted. But on Firebase Auth emulator, there was no way we could whitelist any URL's for 3rd-party auth providers to work while using the Auth Emulator.

The auth emulator (originally localhost:9099) was placed under proxy so that it will be accessible outside the server via domain. (http://auth-uat.homeful.ph)

andrewhamili avatar Aug 02 '22 23:08 andrewhamili

The error you're seeing happens when you're trying to hit a domain (in this case for signing in with redirect) but it hasn't been registered as an authorized domain. Please follow the instructions in the error message to do so, i.e. go to your project at https://firebase.corp.google.com/, go to the "Auth" section, go to "Settings" and add http://auth-uat.homeful.ph to "Authorized Domains". Admittedly, it looks like the error message may be a bit out of date; I'll take a look into updating that.

lisajian avatar Aug 03 '22 01:08 lisajian

Will adding the domain to the production firebase console (https://console.firebase.google.com) also work even if our staging environment is currently using auth emulator?

@lisajian

andrewhamili avatar Aug 03 '22 02:08 andrewhamili

Ah, I see. I'm assuming you're using the JSSDK and followed the instructions https://firebase.google.com/docs/emulator-suite/connect_auth#android_ios_and_web_sdks? You shouldn't be running into that error if you're calling connectAuthEmulator(). We'd need more information about what you're doing to help diagnose the issue (e.g. a minimal reproduction); please either follow the bug template for this repo or if you need to share more info on a non-public platform, please file a customer support issue.

lisajian avatar Aug 03 '22 18:08 lisajian

Hey @andrewhamili. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Aug 12 '22 01:08 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@andrewhamili if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Aug 17 '22 01:08 google-oss-bot

Hi, the goal of this issue is to have an ability to whitelist a domain for some auth providers (google, facebook, etc) so that firebase emulator could be used for staging (demo) environments

andrewhamili avatar May 22 '23 01:05 andrewhamili