You can use facebook login in your websites to allow users to login using their facebook account.you don’t need an extra registration and user management for your sites.you can also manage users in your facebook application page.This tutorial will guide you through integrating the social media site (Face book) into you website using Facebook PHP SDK with an example .
Steps for Facebook login for website
Create Facebook APP ID and APP secret . Step 1 »
- Goto https://developers.facebook.com/apps/and Click Add a New App .
- Choose Website
- Choose Name for you App and Click Create New Facebook App ID
- Choose a category for you App and click Create App ID
- Now Click Skip Quick Test
Step 2 » Under settings, Provide values for App domain ( Eg:www.mangocoders.com ) and Contact Email and click Add Platform.
Step 3 » Now under Status & Review, Click the button to make you App live .
step 4 >> Download the facebook api from https://developers.facebook.com/docs/php/gettingstarted/4.0.0. you can download that the full configured folder from here . login-via-facebookDownload contains all the configuration files . step 5 >> Make a file same as that of test.php from the downloaded folder . Enter your created app id and app secret. In this line of code FacebookSession::setDefaultApplication( 'your app ID','your app secret' );
Enter your redirection url to which the user should come after login through the facebook . $helper = new FacebookRedirectLoginHelper('Enter your url' );
where rest of the code remain the same. Now when you login through the face book a dialog box like below will be displayed(if you are already logged-in else first login to facebook .)
Clicking okay will login you in to the website through facebook