I was slaving over a hot keyboard all Friday!
But at last it is done – FBConnect for sfGuard.
A detailed explanation of how to install it and use it is on the Symfony site.
Anyway, the plugin basically just introduces a new table to keep track of Facebook IDs <---> sfGuardUserIds
Here’s a fun nugget. One of the problems with using FB Connect is that you can’t mug a user’s email address from Facebook. Obviously this is a smart move on Facebook’s part but it makes life hard for my Nigerian spammer friends. If you want to snag a user’s email address (or anything else for that matter) while still using Facebook Connect here’s a sketch of how to do it.
Everything is the same except you can’t use Facebook’s FBML to render the FB Connect button. What you want to do instead is trigger the “connect” event by hand. Here is basically how we do it:
Bam. Got the user’s email address and logged them in via FB Connect.