I have done some research about sharing the auth object across sub domains of my app. Apparently firebase's web sdk this setup.
My idea is to have a single login website login.myapp.com which can be used by my other apps app1.myapp.com, app2.myapp.com to authenticate with. Just like google.
My first attempt was to stringify() the auth object from localStorage, then send it as a url param to the requesting app so that I could parse() the auth object and store it to that app's localStorage.
But I dont like this setup, not only the tokens will be recorded on browser's history, it also looks weird.
So I was wondering if there is a known setup for this using the admin sdk.
- Get auth from
login.myapp.com - Pass the
uidtoapp1.myapp.com app1.myapp.compass theuidto server via http- The server will check if the
uidis authenticated. - If successful, the server will respond an
auth objecttoapp1.myapp.com.
Can the firebase admin produce something like this?
