Facebook PHP SDK 与 getLoginUrl() 相关的问题

发布于 2024-10-07 12:15:43 字数 108 浏览 1 评论 0原文

我在使用 getLoginUrl() 登录 PHP SDK 时遇到问题。当用户单击该函数生成的链接时,它不会显示权限对话框,而是显示 Facebook 徽标,您必须在显示权限对话框之前单击它,请帮助我!

I am having a trouble with PHP SDK logging in using getLoginUrl(). when the user click the link generated by that function it does not show the permission dialog instead it shows a facebook logo you must click it before showing the permission dialog please help me!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怀中猫帐中妖 2024-10-14 12:15:43

显示 Facebook 徽标是因为您的应用程序正在尝试在 iframe 中加载身份验证对话框,这是 OAuth 2.0 不允许的。相反,您的应用程序必须在 _parent 或 _top 或弹出窗口中加载身份验证对话框,这就是您单击 Facebook 徽标时发生的情况。

答案将取决于您的应用程序如何允许用户启动身份验证过程。

许多人都有这样的例子:

  1. 用户到达您的应用程序但尚未注册。
  2. 他们必须单击链接才能开始注册(身份验证)过程。
  3. 单击该链接会显示 Facebook 徽标。单击 facebook 徽标会显示身份验证对话框。

大多数人抱怨步骤 3 有显示 Facebook 徽标的“额外”步骤。

解答:更改您的链接:

从:

到:

[有多种方法可以完成您所要求的任务,此答案显示了人们似乎问得最多的一个,如果这不适用,您将需要提供更多详细信息]

The Facebook logo is showing because your app is attempting to load the auth-dialog within the iframe, which is not allowed by OAuth 2.0. Instead your app must load the auth-dialog in the _parent or _top or in pop-out-window which is what happens when you click on the Facebook logo.

The answer will depend on how your app allow users to start the authentication process.

An example many have is:

  1. user arrives at your app and is not registered with it.
  2. they have to click a link to begin the registration (authentication) process.
  3. clicking the link shows the facebook logo. clicking the facebook logo shows the authentication dialog.

Most people complain that step 3 has the "extra" step of showing the facebook logo.

ANSWER: Change your link:

FROM: <a href="<?=$loginUrl?>">

TO: <a target="_top" href="<?= $loginUrl ?>

[there are several ways to accomplish what you are asking, this answer shows the one people seem to ask about the most, you would need to provide more details if this does not apply]

止于盛夏 2024-10-14 12:15:43

与大多数 oAuth 一样,Facebook 不允许用户通过 iframe 登录。

Facebook does not allow the user to login via an iframe, as with most oAuth.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文