开发者

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 开发者_C百科want to use that party of my application.

Thanks, John


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/


Here is the PHP implementation:

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜