dqd78456 2011-10-23 06:06
浏览 54
已采纳

Facebook App权限请求被用户使用新身份验证禁用

I'm using this code for the app authentication:

    //Obtain the access_token with publish_stream permission 
if(empty($_REQUEST["code"])){ 
    $dialog_url= "http://www.facebook.com/dialog/oauth?"
    . "client_id=" .  $app_id 
    . "&redirect_uri=" . urlencode($post_login_url)
    .  "&scope=publish_stream,user_birthday";
    echo("<script>top.location.href='" . $dialog_url 
    . "'</script>");
}
else {
        $code = $_REQUEST["code"];
    $token_url="https://graph.facebook.com/oauth/access_token?"
    . "client_id=" . $app_id
    . "&client_secret=" . $app_secret
    . "&code=" . $code
    . "&redirect_uri=" . urlencode($post_login_url);
    $response = file_get_contents($token_url);
    $params = null;
    parse_str($response, $params);
    $access_token = $params['access_token'];
}

In the new facebook authentication, the user have the option to choose one of the permission request and cancel it after he click on "Log in" button. for example, the user can disable the request for publish_stream or user_birthday access and still to log into my app. I saw that Zynga and many others still using the old authentication request that looks like:

http://i.stack.imgur.com/ESigT.png (some picture that I've found in the net)

but for some reason in the last 2 weeks my request for permission dialog got changed to the new one: http://i52.tinypic.com/qstm6g.png (some picture that I've found in the net)

How can I switch it back to the old permission dialog? that is only 1 single dialog box and not 2-3 dialog box till the user get logged into my app.

  • 写回答

1条回答 默认 最新

  • donglian4879 2011-10-23 10:58
    关注
    1. I'm not sure if new apps can switch back, and even if you can...it's not recommended since all apps will migrate to the new one soon.
    2. Even with Zynga apps, the user can always revoke these permissions from his/her app privacy settings
    3. You need to deal with the case when a permission is revoked. This is explained in this blog post.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于这个复杂问题的解释说明
  • ¥50 三种调度算法报错 采用的你的方案
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败