A jQuery Plugin For Adding Facebook Login To Your Web App

If you are looking for angular-fblogin you're in the right place. Even though this demo uses the jQuery version of fblogin, it is still applicable since both versions use a similar implementation.

Adding a Login with Facebook option to your web app is a pain! The process requires multiple requests to the Facebook API, and usually results in a messy callback soup that you get stuck managing.

A typical Facebook login flow usually requires the following sequence:

  1. Listen for Facebook SDK load with window.fbAsyncInit
  2. Initiate the Facebook App with FB.init
  3. Request Facebook permissions with FB.login
  4. Request Facebook fields with FB.me(/user)

With the fblogin plugin this is all taken care of with one simple call $.fblogin(options). I modeled the plugin after the jQuery.ajax method, so jQuery user's should feel right at home with the syntax. For full documentation please refer to the README on GitHub.

fblogin Demo

I have created a working demo that allows you to select from a list of valid Facebook permissions for your Facebook login.

comments powered by Disqus