Fb basic version sign In

                                            Fb basic version sign In
                                                           
 Fb basic version sign In


Best practice for Facebook login flow with the JavaScript SDK and PHP SDK v4.1 :: Sammy Kaye Powers
I get a lot of people asking me about the best practice for Facebook login flow. Most of us are used to logging people in using an email address and a hash of their password, but how do you log a user in from Facebook when they never enter a password on your site?

Let's look at the best practices for logging a Facebook user into your web app.
Note: As of writing (Jan 9, 2015) the latest stable version of the Facebook PHP SDK is v4.0. Once v4.1 is released (probably within a month or so), it will have a very different implementation. For this reason, all of the examples included in this post are for v4.1 of the SDK which is currently still in development mode.
Create A Facebook App

If you haven't already, become a Facebook developer and create an app.

You'll need to configure your app to use the "website" platform. To do this you'll need to provide the root URL of your web app.

Related Posts:
Make sure to take note of the app ID and app secret because you'll need those later on.
Understanding User Permissions

Your app will need to ask the user to grant your app certain permissions. The minium permission you can ask a user for is the public_profile permission which grants your app access to the user's public profile. This access is very limited and does not give you access to the user's email or friends list.

Here are a few examples of actions that will require user approval:
You won't be able to access a user's email address unless you ask for the email permission.
You won't be able to post something on a user's timeline unless your ask for the publish_actions permission.
You won't be able to upload a photo album for a user unless your ask for both the user_photos permission and publish_actionspermission.
Meet The Graph API

Before you log a user in, you'll need to understand where the user's information is coming from. You can perform CRUD (create, read, update, delete) operations against data on Facebook via the Graph API.
Fb basic version sign In Fb basic version sign In Reviewed by Efukikata Efet on 04:27 Rating: 5

No comments