使用 Facebook 应用程序的 OAuth 对话框不允许使用画布 URL 作为redirect_uri

发布于 12-29 07:04 字数 1271 浏览 1 评论 0原文

我正在启动 Facebook 应用程序。按照授权部分的入门教程,它说我应该使用这个获得用户许可的 URL:

https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_CANVAS_PAGE

我将用我的画布 URL(我在应用程序设置中看到的 URL)替换 YOUR_CANVAS_PAGE:

https%3A%2F%2Fapps.facebook.com%2F238620302882463%2F

但是,如果我导航到该页面,我会收到以下错误:

An error occurred with Elecciones 2012. Please try again later.

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

如果我替换 YOUR_CANVAS_PAGE with:

http%3A%2F%2Fwww.example.com%2FElecciones2012

权限对话框工作正常。但随后我被重定向到我的网站,而不是 facebook.com 内的应用程序

知道为什么会发生这种情况吗?

我见过其他应用程序使用不同的权限对话:

http://www.facebook.com/connect/uiserver.php?app_id=11609831134&method=permissions.request&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Fpetsociety%2F%3Fpf_ref%3Dsb%26ref%3Dts&response_type=none&display=page&perms=email%2Cpublish_actions&auth_referral=1

但看起来它是另一组 API 的一部分。

I am starting a Facebook app. Following the Getting Started tutorial in the Authorization section, it says I should use this URL to get permission from users:

https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_CANVAS_PAGE

I am replacing YOUR_CANVAS_PAGE with my canvas URL, the one I see on my app settings:

https%3A%2F%2Fapps.facebook.com%2F238620302882463%2F

But, then, if I navigate to that page, I get the following error:

An error occurred with Elecciones 2012. Please try again later.

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

If I replace YOUR_CANVAS_PAGE with:

http%3A%2F%2Fwww.example.com%2FElecciones2012

The permission dialog works fine. But then I get redirected to my website, not the app inside facebook.com

Any idea why is this happening??

I have seen other apps using a different permission dialogue:

http://www.facebook.com/connect/uiserver.php?app_id=11609831134&method=permissions.request&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Fpetsociety%2F%3Fpf_ref%3Dsb%26ref%3Dts&response_type=none&display=page&perms=email%2Cpublish_actions&auth_referral=1

But it looks it is part of another set of APIs.

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

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

发布评论

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

评论(1

梦巷2025-01-05 07:04:21

我也遇到了同样的问题。看起来问题出在“Canvas URL”中。您不能在画布 URL 中使用您的应用程序 ID,例如:

“https%3A%2F%2Fapps.facebook.com%2F238620302882463%2F”

相反,命名空间应用作画布 URL。例如:

“https://apps.facebook.com/myapplication/”

您可以在 facebook 的应用程序设置中设置您的应用程序命名空间。

I got the same problem too. Looks like the problem is in "Canvas URL". You cannot use your app id in canvas URL like:

"https%3A%2F%2Fapps.facebook.com%2F238620302882463%2F"

Instead, the namespace should be used as your canvas URL. for example:

"https://apps.facebook.com/myapplication/"

You can set your app namespace in the application settings in facebook.

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