我正在尝试实现facebook身份验证器(对于fb上的应用,而非网站访问)但收到此错误:“验证客户端密码时出错.OAuthException”。
这是代码的一部分:
$user = $facebook->getUser();
if ($user) {
if(empty($code)){
$dialog_url = "https://graph.facebook.com/oauth/"
."access_token?"
."client_id=".$fbconfig['appid']
."&redirect_uri=".urlencode($args['redirect_uri'])
."&scope=publish_stream,email";
echo "<script type='text/javascript'>top.location.href = '$dialog_url';</script>";
$user_profile = $facebook->api('/me');
echo "AAA";
}else{
$token_url = "https://graph.facebook.com/oauth/"
."access_token?"
."client_id=".$fbconfig['appid']
."&redirect_uri=".urlencode($args['redirect_uri'])
."&client_secret=". $fbconfig['secret']
."&code=".$args['scope'];
$response = file_get_contents($token_url);
$params = null;
parse_str($response, $params);
$access_token = $params['access_token'];
echo "aaaaaaaaaaa";
}
}else{
$loginUrl = $facebook->getLoginUrl($args);
echo $loginUrl;
echo "<b>Attendere caricamento di permessi da richiedere all'utente...</b>";
echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
exit();
}
为什么我会收到此错误? App_id和secret_id是正确的。 怎么了?
由于