我正在尝试实现 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 是正确的。怎么了 ?
谢谢