DEV Community

Discussion on: How to share Firebase Authentication across subdomains

 
mikgross profile image
Mikael

Maybe I am misunderstanding something here or badly expressing myself..

What I am doing atm:
1) Sign-in and get token ID from the client
2) send the token ID to functions, validate token ID, generate session cookie and a jwt token in Functions, return the two values to the client
3) in the client set the two cookies for domain *.domain.com
4) all cookies are available accross all subdomains (tested), so I can perform the authchecks required

Something I am missing?

Thread Thread
 
johncarroll profile image
John Carroll • Edited

That sounds good. Sounds like the same thing this blog post suggests. Honestly though, I'm no security expert. I'm confident enough that following the steps in this post will work and is secure (after having spent a while researching it), but I have no advice if you are looking to do some variation of this.

This post is really just a summary of my findings after spending a week working on this problem. Beyond what's here though, you're on your own.