Patching Torii’s Facebook Connect for Chrome iOS

Hugh Francis
Sanctuary Computer Inc
2 min readNov 25, 2015

We recently setup Torii in an Ember CLI app, and were super happy with how easy it was. It’s a great little library for handling client-side social authentication in a neat and sane way.

However — after putting the app into production, we were greeted with this fun error in Chrome iOS:

Turns out there’s a long running issue with the way Chrome iOS handles cross-window communication.

The Workaround

However! Facebook also supports a manual URI based oAuth flow too. Here’s how we patched Torii’s Facebook Connect Provider to fallback to that flow in Chrome iOS.

Here’s how we patched it:

For this to work, be sure to add your Redirect URI in the Advanced Settings of your Facebook App ID here:

Please note — during the manual process, your Ember application will be restarted. This means any ephemeral state (such as “captured transitions” for after Authentication) will be lost. It would be nice to add some “serializeApplicationState” and “deserializeApplicationState” hooks to this flow.

Hope this helps someone out!

--

--