gpt4 book ai didi

php - 跳过 Facebook 身份验证时,我不应该取回一个适当的值来指示用户的决定吗?

转载 作者:可可西里 更新时间:2023-11-01 12:17:59 25 4
gpt4 key购买 nike

在我的应用程序中,我有以下代码:

$loginUrl = $facebook->getLoginUrl( array( 'scope' => 'publish_stream' ) );
header("Location: ".$loginUrl);

将用户带到 facebook 并询问他们:

'[oshirowanens app] would also like permission to:
Post on your behalf
This app may post on your behalf, including status updates, photos and more.
Allow - Skip

如果我点击Skip,我将被重定向回我的应用程序,在那里我希望看到以下 url 参数 errorerror_reason , 和 error_description 类似于当我的用户无法登录他们的 facebook 帐户时发生的情况?

(optional) The URL to redirect the user to once the login/authorization process is complete. The user will be redirected to the URL on both login success and failure, so you must check the error parameters in the URL as described in the authentication documentation. If this property is not specified, the user will be redirected to the current URL (i.e. the URL of the page where this method was called, typically the current URL in the user's browser).

来源:https://developers.facebook.com/docs/reference/php/facebook-getLoginUrl/

是否存在像 publish_stream 这样的可以跳过权限验证请求的东西?

最佳答案

实际上,如果您从 FB 看到登录过程,它将分为两个步骤。

首先,您将被要求使用您的 FB 帐户登录,在同一页面上,您可以看到应用程序正在向用户寻求的“基本权限”列表。

在此步骤之后,您将看到另一个对话框,其中包含一组权限,称为 Extended permissions。使用“接受”和“跳过”。扩展权限是用户可以决定跳过的权限,即使在跳过之后用户也将能够访问应用程序。

因此,当用户跳过扩展权限时,FB 不会将此视为错误,因此不会向应用程序返回任何内容。

不过如果你觉得你请求的权限对你的应用程序很重要,你可以在你即将进行与该权限相关的操作时询问他们。在您的情况下,当您要在用户的墙上发帖时,您可以请求该许可,然后执行操作。

参见 here关于如何处理丢失的权限。

您也可以在 best practices 上访问 FB 指南在请求权限时。

关于php - 跳过 Facebook 身份验证时,我不应该取回一个适当的值来指示用户的决定吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14891329/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com