Q:

What will be the Firebase Authorized Domain for Firefox Packaged App?

My packaged app for Firefox OS uses Firebase and Firebase Facebook Login for user authentication. However, in Firebase I need to provide a Authorized domain for oauth redirect. What will be my Authorized domain for a Firefox OS packaged app?
I ran this app in the FF OS simulator through FF WebIDE and from there I got an app id which I used as a Aauthorized domain in Firebase and it (fb login) worked. But then I submitted my packaged app in the Firefox marketplace and got rejected as Facebook Login is not working.
What am I missing here? 

A:

I would guess it works via the simulator because you are on localhost, which is whitelisted in your account dashboard. Naturally, you aren't going to be able to create a whitelisted domain that works within the packaged app.
Instead, to make integrated auth work, you'd need to set up a hosted login page and feature that in your app, then you can whitelist the hosted page instead. For example, if you hosted your login form at yourinstance.firebaseapp.com:

Whitelist yourinstance.firebaseapp.com
App redirects to or "iframes" https://yourinstance.firebaseapp.com/login.html
When login is completed, login.html returns the userData.token to packaged app
Packaged app calls authWithCustomToken(token) 

Alternately, and possibly a much simpler and more elegant solution, you could sign your own tokens and utilize those in the packaged app.

