firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

[FR] - Ability to set auth domains via admin SDK

Open imjared opened this issue 4 years ago • 14 comments

Is your feature request related to a problem? Please describe. We're trying to deploy preview branches onto appengine using versioning. This results in URLs like http://[VERSION_ID]-dot-[YOUR_PROJECT_ID].appspot.com. We want to be able to run E2E tests against preview branches and send links to stakeholders for previewing. Unfortunately with Firebase authentication, we have to manually set each whitelisted subdomain we want to use. This isn't the end of the world but it'd be nice to say "hey, we own this appengine (or whatever) namespace, whitelist everything under it."

Describe the solution you'd like I'd like to either:

  1. In Firebase control panel, be able to wildcard a path for authentication. eg. *-dot-[YOUR_PROJECT_ID].appspot.com
  2. Using Firebase-admin SDK, we'd want to programmatically set a whitelisted domain for authentication. Something along the lines of admin.auth().validateDomain(...) might work for our use case.

Describe alternatives you've considered As an alternative, we've:

  • thought about trying to proxy our GAE dev instance via some CDN black magic where domains actually all become fourth level domains (unclear if this would even work)
  • thought about manually adding whitelisted domains in Firebase for every PR we push 😭

Additional context Just to be crystal clear, this is for the domain whitelisting that happens at https://console.firebase.google.com/u/0/project/[PROJECT_ID]/authentication/providers

imjared avatar Oct 19 '19 22:10 imjared

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Oct 19 '19 22:10 google-oss-bot

Can you also file an official feature request for this.

bojeil-google avatar Nov 07 '19 17:11 bojeil-google

Any news on that?

Benny739 avatar Feb 22 '20 15:02 Benny739

@bojeil-google @hiranya911 Do you have any update on where this sits in product roadmap?

nickgrives avatar May 20 '20 11:05 nickgrives

This is exactly what we need too. Probably some kind of regex support for a domain name would be the best quick fix!

landsman avatar Jun 28 '21 15:06 landsman

We are also in need of this feature, is there any update on this?

rodolfofranco avatar Oct 11 '21 17:10 rodolfofranco

or just REST API would be great! 🙏

landsman avatar Oct 11 '21 19:10 landsman

Hi, We are also in need for this. Actually this is a must for our project and the alternative is really to find another auth provider - which would be a big headache. Pls, let us know if this is consider in the upcoming roadmap tks

cesariomartins avatar Oct 14 '21 01:10 cesariomartins

Hello, I just found this issue right now. I've seen a workaround so I thought I should comment it here.

or just REST API would be great!

This seems to be possible now by using the Identity Toolkit API

projects.getConfig returns a Config, which contains authorizedDomains which is the list of domains set.

projects.updateConfig lets you update a portion of the Config, so you can add to the response of getConfig and update the whole authorizedDomains structure.

This blog helped me understand how to use these APIs: Firebase Auth authorized domains | (p)retired I've also seen a JavaScript solution here: Any API to add an authorized domain to Firebase Auth? - Stack Overflow

stefafafan avatar Jun 11 '22 14:06 stefafafan

everything can be solved if wildcard domains are allowed

kasvith avatar May 01 '23 14:05 kasvith

any update after several years? 😢

landsman avatar May 01 '23 17:05 landsman

bump

psettachatgul avatar Dec 07 '23 15:12 psettachatgul

I lost patience with Firebase. Consider @supabase as a progressive replacement.

landsman avatar Dec 07 '23 22:12 landsman

@landsman just in case you are still waiting. As of now, I am using "Blaze Plan" and I can use Firebase Auth to access temporarily deployed applications in sub-domains. Namely, in Authorized Domains I have URLs as company.com and development.company.com and I am able to access services on service.development.com or services-pr.development.company.com I do not have any additional configuration. Hope it helps.

abseht avatar Jan 08 '24 21:01 abseht