我尝试了几种方法,例如。这里没有运气。我正在使用他们的facebook php sdk。
现在发生的情况是应用程序在通过身份验证后被重定向到我的网站。
<?php
require_once 'php-sdk/facebook.php';
$app_id = "***";
$app_secret = "***";
$facebook = new Facebook(array(
'appId'=> $app_id,
'secret' => $app_secret,
'cookie' => true
));
$user = $facebook->getUser();
if(!$user)
{
$auth_url = $facebook->getLoginUrl(array('scope' => 'email'));
echo("<script> top.location.href='" . $auth_url . "'</script>");
}
?>
我尝试将 auth_url 替换为:
$auth_url = $facebook->getLoginUrl(array('scope' => 'email',
'redirect_uri' => 'http://apps.facebook.com/ridetogether'));
但提示告诉我 redirect_url 不归我所有:
Ride Together 出现错误。请稍后再试。
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.
我还能做些什么来重定向回 facebook 内的画布应用程序?