请求无效,因为app secret与客户端令牌相同

Raj*_*jan 4 php api facebook facebook-graph-api

我的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'];
Run Code Online (Sandbox Code Playgroud)

错误是:

{
   "error": {
      "message": "The request is invalid because the app secret is the same as the client token",
      "type": "OAuthException",
      "code": 1
   }
}
Run Code Online (Sandbox Code Playgroud)

如何解决这个问题?

我也使用curl,但响应是:

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)
    }
} 
Run Code Online (Sandbox Code Playgroud)

isy*_*syi 7

确保客户端令牌与应用程序密钥(高级>安全性)不同,并确保您的应用程序是Web应用程序而非本机应用程序.