3

Identification by Facebook

The identification and registration forms can directly obtain the email address of a Facebook account. You must install the Facebook SDK for PHP then configure the option $with_facebook of the blocks login and register. NOTE: The version of the SDK used is still version 3 in order to maintain the compatibiliy with PHP 5.3.

Facebook SDK

Create a folder facebook at the root of the site:

$ mkdir facebook

Clone with Git the deposit of the Facebook SDK in the folder sdk of the folder facebook:

$ cd facebook
$ git clone https://github.com/facebook/facebook-php-sdk.git sdk

IMPORTANT: PHP must have the extension mbstring.

login.php and register.php

Edit the files login.php and register.php. Set the parameter $with_facebook to true to activate the interface with Facebook.

The code obtains the user's email address from Facebook then validates it as if the user had typed it but without checking the password in the identification form. The registration form, if the parameter $with_info is true, will also extract the user's last name and first name from the Facebook profile.

Comments

To add a comment, click here.