重定向url为facebook桌面应用程序

Redirect url for facebook desktop app

本文关键字:桌面 应用程序 facebook url 重定向      更新时间:2023-09-26

我正在尝试使用node webkit开发一个facebook桌面应用程序。我试图找到一种方法来使用facebook客户端Javascript sdk访问图形功能。我正在使用以下代码尝试连接到facebook。(https://gist.github.com/konsumer/2298cc4f8b7b0a1ee9fa file-nwfacebooklogin-js)

然而,当我给重定向URL为https://www.facebook.com/connect/login_success.html它给出了一个错误Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

我应该给什么URL,因为我不会在一个网站上托管这个

我认为这不可能。我通过在我们的服务器上打开一个新标签,在批准的域名(将其添加到facebook的"应用域")上'登录facebook'。

为了传递登录数据,我使用 打开了新选项卡
var login_window = window.open(url,{
    "position": "center",
    "focus": true
});

然后,在该页面上,在从facebook重定向回来后,在收到访问令牌后,我保存在页面sessionsStoragee中,并使用

从第一个选项卡访问它:
login_window.window.sessionStorage.login_data