DEV Community

Discussion on: Cross-Domain Firebase Authentication: A Simple Approach

Collapse
 
thammada profile image
Thee Sritabtim

Interesting approach. At step (I.2) do you suggest POSTing the ID Token inside the http body to app1.domain.com/auth/login? If so, how is it different from POSTing it to a http cloud function directly (possibly hosted on auth.domain.com)?

Collapse
 
brianburton profile image
Brian Burton • Edited

For your first question, yes I POST the ID token inside the body to /auth/login.

For your second question, the /auth/login endpoint checks and sets a session cookie for that domain, so it needs to be on the same domain. Another minor benefit is that it also avoids potential CORS errors.