Search code examples
authenticationfirebasewebkitfirebase-authenticationoffice-js

Getting error using Firebase popup authentication in Word add-in


I was already using Firebase for authentication for other (related) projects and would like to stick with it.

Using Firebase with a Word add-in seems challenging. On Windows you're stuck with IE11 and on Mac (crucial for me) the browser used to load a taskpane is webkit, not the default browser.

I can get authentication on Windows to work just fine if I use signInWithRedirect (Google and Facebook).

But this won't work on Mac. Using signInWithRedirect opens a new tab in the default browser, which doesn't share cookies/data with the webkit browser the add-in actually uses.

When I switch to signInWithPopup, I get:

There is no application set to open the URL about:invalid%23zClosurez.

On Windows I get a popup IE11 window, for a split second, and it contains about:invalid%23zClosurez for a URL.

I have appdomains called out in my add-in XML manifest:

<AppDomains>
    <AppDomain>https://writeitwithme-a114a.firebaseapp.com</AppDomain>
    <AppDomain>https://www.firebaseapp.com</AppDomain>
    <AppDomain>https://www.googleapis.com</AppDomain>
    <AppDomain>https://www.facebook.com</AppDomain>
</AppDomains>

Any help appreciated. Worst case I drop to using manual registration, via Firebase, for Mac, but seems unfortunate to have to give up.


Solution

  • Just documenting for anyone finding this later.

    • I couldn't figure out how to use Firebase social login when creating an add-in for Mac. Every authentication window opened in the default browser, not the webkit engine used by Word on Mac. Sticking with manual login worked.
    • IE11 is always finicky when using localhost. I test elsewhere, then push files live and then try IE11 and social + manual login (via popup) works just fine.