Facebook permission extension

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

So, as soon as he pressed the login button, he granted permissions for the application, but for a certain part of the application I need, for example, create_events permission, but I do not want this from everyone, only from those who want to use this side of my application.

Thanks, John

+3
source share
2 answers

It took me a while to figure this out. What you need to do is click Sign In again. If the user is already registered, Facebook checks what permissions you request in the "login" function, in relation to what is already granted. If some permissions have not yet been granted, Facebook asks the user for additional permissions, and not for re-entering the system. That you use the login function to request additional permission, I think this is intuitive. But that’s how you’ll ask for different permissions only when necessary, which is recommended by Facebook.

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

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

+3
source

Here is the PHP implementation:

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

0
source

Source: https://habr.com/ru/post/1794907/


All Articles