繁体   English   中英

用应用程序未登录的Facebook网站登录

[英]facebook website login with app not doing login

我只是Facebook应用程序的新手,我正在使用应用程序ID从Facebook SDK进行页面简单登录。

我已经在Facebook中创建了该应用程序。 之后,我的Facebook代码看起来像这样

window.fbAsyncInit = function() {
   FB.init({
     appId      : '619422074760339', // App ID
     channelURL : '', // Channel File, not required so leave empty
     status     : true, // check login status
     cookie     : true, // enable cookies to allow the server to access the session
     oauth      : true, // enable OAuth 2.0
     xfbml      : false  // parse XFBML
   });
};

我已经给出了appId和密钥。 当我尝试使用此脚本从本地主机登录时,显示出类似以下错误

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.

所以有人可以告诉我如何解决这个问题。 任何帮助和建议都是非常可取的。 谢谢

您的应用程序所运行的服务器没有与Facebook Apps设置中提供的URL相同的URL。

请检查两个URL,它们必须相同。

我遇到了同样的问题,我发现“ redirect_uri”和“有效的OAuth重定向URI”不匹配。

在我的代码中,我设置了:

redirect_uri = "http://www.mywebsite.com/validate.php";

但是在我的Facebook应用中,我已经设置了有效的OAuth重定向URI(在“设置”中):

http://website.com/validate.php

我所缺少的只是“ www”。 因此,我将我的Facebook应用中的有效OAuth重定向URI更改为以下内容:

http://www.website.com/validate.php

我对我来说就像魔术一样。 希望对您有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM