Facebook 连接错误? (授权后 URL 被放入窗口中,而不是 OnLogin 回调)

发布于 2024-09-19 12:43:58 字数 1062 浏览 2 评论 0原文

我有一个 ASP.NET 网站,它使用 Facebook Connect 进行身份验证 - 使用 JavaScript API 和 Facebook Connect FBML 按钮。

以下是当用户未登录 Facebook 时单击“连接 Facebook”按钮的常规事件流程。

  1. 显示对话框,请求用户登录
  2. 对话框请求用户授予基本信息权限
  3. 弹出窗口关闭
  4. 我为“onlogin”提供的回调函数被触发。

一切都好。

现在 - 我认为这是一个错误:用户已经通过 Facebook 身份验证,但尚未授权我的应用程序。

流程如下:

  1. 显示对话框,请求用户授予基本信息权限
  2. 弹出窗口的 URL 更改为 http://rootofmysite.com/?installed=1&token=3e3920d309
  3. 用户想知道发生了什么,并且 onlogin 回调不会被触发。

那么,弹出窗口被替换为我的原始站点,并且查询字符串中是 OAuth 令牌?这看起来是 Facebook 应用程序设置中曾经的“授权后回调”URL,但已被删除。无论如何,我不关心这个 URL - 我使用客户端 JavaScript API 请求权限/授权,我确信很多人都这样做。

我知道用户已经通过身份验证,所以他们不需要再次登录,但我不明白的是 a) 为什么不调用“onlogin”事件处理程序,以及 b) 他们到底为什么用我的对话框替换他们的对话框站点和 url 中的 OAuth 令牌?

目前,我正在尝试做一个“创造性的解决方法”,我检测这个 URL 并关闭弹出窗口并手动调用我的“onlogin”处理程序(Facebook 应该做什么)。

不过,还是很狡猾。

编辑

这是另一个错误。请投票支持,以便他们修复它。

I have a ASP.NET web site which uses Facebook Connect for authentication - using the JavaScript API and the Facebook Connect FBML Button.

Here is the regular flow of events for a "Connect with Facebook" button click, when user isnt logged into Facebook.

  1. Dialog is shown requesting user to login
  2. Dialog requests permission from the user for basic info permission
  3. The popup is closed
  4. The callback function i supplied for "onlogin" is fired.

All good.

Now - here's what i think is a bug: the user is already authenticated to Facebook, but has not authorised my app.

This is the flow:

  1. Dialog is shown requesting permission from the user for basic info permission
  2. The URL for the popup changes to http://rootofmysite.com/?installed=1&token=3e3920d309
  3. The user is left wondering what is going on, and the onlogin callback is NOT fired.

So, the popup window is replaced with my original site, and in the querystring is the OAuth token? This looks to be the "Post-Authorise Callback" URL which used to be in the Facebook Application Settings - but has been removed. Anyway, i dont care about this URL - i request permissions/authorization using the client-side JavaScript API, as im a sure a lot of people do.

I understand the user is already authenticated, so they wouldn't need to login again, but what i dont understand is a) why the "onlogin" event handler is not called, and b) why on earth are they replacing THEIR dialog with my site and the OAuth token in the url?

At the moment, i am trying to do a "creative workaround" where i detect this URL and close the popup and call my "onlogin" handler manually (what Facebook SHOULD be doing).

Still, quite dodgy.

EDIT

It's another bug peoples. Please vote for it so they fix it.

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

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

发布评论

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

评论(1

好久不见√ 2024-09-26 12:43:58

这是一个(未经证实的)错误。

http://bugs.developers.facebook.net/show_bug.cgi?id= 12260

希望它能得到更多的选票,以便它得到修复 - 投票给人们!

与此同时,我(尝试)采用以下“创造性解决方法”:

  1. 向我的 Default.aspx 页面添加逻辑以检测它们在弹出窗口中重定向到的 URL。
  2. 重定向到我的页面 FacebookInboundAuthorization.aspx,保留查询字符串。
  3. 加载该页面时,注册一些 JavaScript 以关闭弹出窗口并手动触发我的按钮的“onlogin”事件处理程序。

编辑

为了澄清我的上述内容,我的意思并不是“投票给人们”,而是投票给我的答案,我的意思是投票给 Bugzilla 上的错误(以便 FB 接受它作为一个问题并修复它) 。

It's a (unconfirmed) bug.

http://bugs.developers.facebook.net/show_bug.cgi?id=12260

Hopefully it gets more votes so it gets fixed - vote people!

In the meantime, i am (attempting) to employ the following 'creative workaround':

  1. Add logic to my Default.aspx page to detect that URL they are redirecting to in the popup.
  2. Redirect to my page, FacebookInboundAuthorization.aspx, preserving querystring.
  3. On load of that page, register some JavaScript to close the popup and manually fire the "onlogin" event handler for my button.

EDIT

To clarify my above, i didnt mean "vote people" as in to vote for my answer here, i meant vote for the bug on Bugzilla (so that FB accept it as an issue and fix it).

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