Facebook 应用程序权限请求被用户使用新的身份验证禁用
我使用此代码进行应用程序身份验证:
//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'];
}
在新的 Facebook 身份验证中,用户可以选择选择一项权限请求,并在单击“登录”按钮后取消它。例如,用户可以禁用对publish_stream或user_birthday访问的请求,但仍然登录我的应用程序。 我看到 Zynga 和许多其他人仍在使用旧的身份验证请求,如下所示:
https://i.sstatic。 net/ESigT.png (我在网上找到的一些图片),
但由于某种原因,在过去的两周里,我的权限请求对话框已更改为新的: http://i52.tinypic.com/qstm6g.png (我找到的一些图片在网上)
我怎样才能将其切换回旧的权限对话框?在用户登录我的应用程序之前,这只是 1 个对话框,而不是 2-3 个对话框。
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:
https://i.sstatic.net/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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)