【问题标题】:Redirect url for facebook desktop appfacebook 桌面应用程序的重定向 url
【发布时间】:2015-07-16 00:07:53
【问题描述】:

我正在尝试使用 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,因为我不会在网站上托管它。

【问题讨论】:

  • 您是否在应用程序设置中配置了任何“网站”平台?这可能会导致此问题。

标签: javascript facebook facebook-graph-api node-webkit


【解决方案1】:

我认为这是不可能的。我通过在我们的服务器上打开一个新选项卡,在已批准的域上(将其添加到 facebook 的“应用程序域”)来“使用 facebook 登录”。

为了传递登录数据,我使用

打开了新选项卡
var login_window = window.open(url,{
    "position": "center",
    "focus": true
});

然后,在该页面上,在从 facebook 重定向回来后,在收到访问令牌后,我保存在页面 sessionsStoragee 中,并使用以下命令从第一个选项卡访问它:

login_window.window.sessionStorage.login_data

【讨论】:

    猜你喜欢
    • 2016-09-30
    • 1970-01-01
    • 1970-01-01
    • 2012-03-07
    • 2011-04-10
    • 1970-01-01
    • 2011-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多