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.
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.
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:
- Fb basic version sign In
- Facebook Login Mobile Site
- How To Change Single Name On Facebook
- www facebook com com login
- Fb account login Page
- How To See Sent Messages On Facebook That Deleted
- How To Post Moving Pictures On Facebook
- Facebook Login In Desktop View On Mobile
- How to know when someone blocked you on Facebook
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.
0 comments:
Post a Comment
Facebook has greatly reduced the distribution of our stories in our readers' newsfeeds and is instead promoting mainstream media sources. When you share to your friends, however, you greatly help distribute our content. Please take a moment and consider sharing this article with your friends and family. Thank you.