Oliver Nassar

Facebook Connect Workflow

May 24, 2013

In working on Podium, a site which aggregates upcoming talks in Toronto, I ran into a challenge that I'm sure many others have faced: implementing a comprehensive workflow including Facebook Connect.

With our next version, we want visitors to have the option of connecting through Facebook, or by creating a custom Podium account. This presents particular challenges that I couldn't find documented too well online.

This post will document the flow after a user successfully connects their Facebook account and my server receives a request at /facebook/connect. At the end of the post you'll find a diagram I drew that helped guide me through the logic.

I'm using PHP on the server side, but since it's logistical, it shouldn't really matter.

Login/Workflow

I wouldn't be surprised if there are some edge cases that I'm missing here. This logic makes solid sense to me. I imagine something similar (yet hopefully less complex) will be required for the /facebook/disconnect request/workflow.

I hope this helps someone else. It took some time to sketch out, but was worth it I reckon. If you're in Toronto, check out Podium, won't ya ;)

Sketch

Facebook Connect Workflow

Updates

The picture is already out of date, as I added in a check against the primary email of the Facebook account. There is an edge case I thought of, but am choosing not to address due to it's unliklihood. Namely, that a Facebook account is connected to a Podium account, then the Facebook primary email is changed, and then the visitor attempts to disconnect their Facebook account from Podium and reconnect it to a different Podium account.

Phewf. Ya, not accounting for that :P