重定向 URI 参数导致应用程序在身份验证时离开 Facebook 框架
我可以看到还有其他类似的主题,但它们已经过时了,而且在 Facebook 上,任何建议在大约一周后似乎都可能过时了!所以我想重新检查一下。我的应用程序一切正常,并且身份验证没有任何问题。然而,经过身份验证后,您将被重定向到 Facebook 框架之外。我使用 PHP 方法并使用他们网站上的示例来执行此操作。
top.location.href='http://www.facebook.com/dialog/oauth?...&redirect_uri=http://www.myhosting.com/'
这个redirect_uri正确吗?我知道它是为了匹配您的应用程序设置中的某些内容,但他们不断更改所有内容的名称 - 它是为了匹配我的画布页面 https://apps.facebook.com/myappname/
或我的画布 URL http://www.myhosting.com
?正如你所看到的,我已经得到了与第二个 Canvas URL 相匹配的结果。如果我尝试使其与画布页面匹配,则会收到错误(简单地说发生错误
)。有人可以确认 redirect_uri
到底要匹配什么吗?
I can see there are other similar topics, but they are old and in the world on Facebook any advice seems likely out of date after about a week! So I wanted to check afresh. My app is all working fine, and authenticating without any problems. However after authenticating you are redirected outside of the Facebook frame. I'm doing this with the PHP method, using the examples on their site.
top.location.href='http://www.facebook.com/dialog/oauth?...&redirect_uri=http://www.myhosting.com/'
Is this redirect_uri correct? I know it is meant to match something in your app settings but they keep changing the names of everything - Is it meant to match my Canvas Page https://apps.facebook.com/myappname/
or my Canvas URL http://www.myhosting.com
? As you can see I have got it matching the second, the Canvas URL. If I try to make it match the Canvas Page I get an error (simply says an error occurred
). Can someone please confirm what exactly the redirect_uri
is meant to match?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
两者都可以工作,如果您希望用户在登录后登陆您的画布页面,请将redirect_uri设置为您的画布页面
{在下面的评论后编辑} - 我绝对确定这会工作 - 将redirect_uri设置为
http: //apps.facebook.com/<您的应用程序命名空间>
,用户将被引导回您的画布应用程序Both will work, if you want the user to land on your canvas page after login, set the redirect_uri to your canvas page
{edit after comments below} - i'm absolutely sure this will work - set the redirect_uri to
http://apps.facebook.com/<your app namespace>
and the user will be directed back into your canvas app