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

时间:2012-01-27 07:30:28

标签: dialog facebook-apps

我正在开始一个Facebook应用程序。在Getting Started tutorial in the Authorization section之后,它说我应该使用此网址获得用户的许可:

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

我正在用我的画布网址替换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替换为:

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的一部分。

1 个答案:

答案 0 :(得分:0)

我也遇到了同样的问题。看起来问题出现在“画布URL”中。您无法在画布网址中使用您的应用ID:

  

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

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

  

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

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