我的Facebook应用昨天工作正常,但今天它无法获取access_token。该请求无效,因为应用密钥与客户端令牌相同
我的代码是:
$token_url="https://graph.facebook.com/oauth/access_token?"."client_id=".$app_id."&redirect_uri=".urlencode($my_url)."&client_secret=".$app_secret."&code=".$code;
$response=file_get_contents($token_url);
print_r($response);
$params = null;
parse_str($response, $params);
echo $params['access_token'];
的错误是:
{
"error": {
"message": "The request is invalid because the app secret is the same as the client token",
"type": "OAuthException",
"code": 1
}
}
如何解决这个问题?
我也用卷曲,但反应是:
object(stdClass)#121 (1) {
["error"]=> object(stdClass)#11 (3) {
["message"]=> string(77) "The request is invalid because the app secret is the same as the client token"
["type"]=> string(14) "OAuthException"
["code"]=> int(1)
}
}
你如何实例化Facebook的对象?请在此处添加代码块。鉴于错误消息,它看起来像你传递给构造函数的值是无效的或不正确的。 – 2013-04-04 13:03:44
如果我使用新的app_id和app_secret然后正常工作....... – Rajan 2013-04-04 13:09:42
你可以发布这个问题的答案吗?如果你使用了新的app_id和app_secret,你的意思是什么?你是否在fb dev页面申请了新的? – isyi 2013-04-04 19:58:09