Setting up extended permissions during login

A Facebook application is often required to access the user's profile, to post messages on his/her wall as well as on his/her friends' wall, to publish pictures, and so on. However, for security reasons, all these tasks are not allowed by default by Facebook and we need to request specific permission, known as extended permission, for each task from the user. This can be easily done at the client side using the Facebook JavaScript SDK.

Getting ready

You should have set up index.php, as explained in the beginning of the chapter.

How to do it...

The following steps will help in setting up extended permissions:

  1. Open index.php and add a login button inside the div fb-root:
    <div id="fb-root"> <!-- Your application ...

Get Facebook Application Development with Graph API Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.