[英]Facebook App Login Error
I've been looking everywhere for a solution to my problem, but to no avail so far. 我一直在到处寻找解决我的问题的方法,但到目前为止仍然无济于事。
I'm following steps to create a Facebook app from a Facebook Tutorial and I've run into a problem in the logging in process even though I seem to be doing everything correctly. 我正在按照步骤从Facebook教程创建Facebook应用,尽管我似乎做得正确,但在登录过程中遇到了问题。 When the app tries to login, I get the following error:
当应用尝试登录时,出现以下错误:
Given URL is not permitted by the application configuration.: One or more of the given URLs is not allowed by the App's settings.
应用程序配置不允许使用给定的URL 。:应用程序的设置不允许使用一个或多个给定的URL。 It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
它必须与网站URL或Canvas URL匹配,或者域必须是该应用程序域之一的子域。
You would think that there's something wrong with my app configuration, but that doesn't seem to be the case. 您可能会认为我的应用程序配置有问题,但事实并非如此。 Here's a screenshot:
这是屏幕截图:
The canvas URL is correct and I've tested with or without the App Domains field filled out. 画布URL是正确的,无论是否填写了“应用程序域”字段,我都进行了测试。 Here is the php for the login:
这是用于登录的php:
<?php
require 'server/fb-php-sdk/facebook.php';
$app_id = '236534686497558';
$app_secret = '***************************';
$app_namespace = 'mytestsmash';
$app_url = 'https://apps.facebook.com/' . $app_namespace . '/';
$scope = 'email,publish_actions';
// Init the Facebook SDK
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
));
// Get the current user
$user = $facebook->getUser();
// If the user has not installed the app, redirect them to the Login Dialog
if (!$user) {
$loginUrl = $facebook->getLoginUrl(array(
'scope' => $scope,
'redirect_uri' => $app_url,
));
print('<script> top.location.href=\'' . $loginUrl . '\'</script>');
}
?>
I can't figure out what's going wrong here. 我不知道这里出了什么问题。
意识到问题是$ app_url是php中的httpS ...但是设置中的画布页面url只是http!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.