John
John

Reputation: 33

Facebook, extending permissions

Is it possible to extend the original permissions given by the user?

So, once he clicked the login button, granted the permissions for the application, but for a specific part of the application I need for example the create_events permission but I don't want it from everyone, just from those who want to use that party of my application.

Thanks, John

Upvotes: 3

Views: 613

Answers (2)

James Corr
James Corr

Reputation: 81

Here is the PHP implementation:

$loginUrl = $facebook->getLoginUrl(array( "scope" => "read_stream,publish_stream" ));

Upvotes: 0

Brent Baisley
Brent Baisley

Reputation: 12721

It took me a while to figure this one out. What you have to do is prompt to "login" again. If the user is already logged in, Facebook checks what permissions you are asking for in the "login" function against what is already granted. If some permissions are not yet granted, Facebook prompts the user for those extra permissions, NOT to re-login. That you use the login function to prompt for additional permission I think is counter intuitive. But this is how you would prompt for different permissions only when needed, which is what Facebook recommends.

FB.login(function(response) {
...
}, {'perms':'read_stream,publish_stream,offline_access'});

http://developers.facebook.com/docs/reference/javascript/fb.login/

Upvotes: 3

Related Questions