I am a beginner to Facebook app development. I am stuck with an authentication issue, I am trying to use this url:
https://graph.facebook.com/oauth/access_token?client_id=$client_id&client_secret=$client_secret&type=client_credentials&redirect_uri=http://www.wesbite.com/facebook/&scope=email,offline_access
but I receive this error: "Invalid verification code format."
I have been trying to solve it for the last three hours and no result. I try to google this message but apparently it is not that popular.
can you please help?
Edit: I use this function:
function get_contents($link)
{
if (function_exists('curl_init')) {
$curl = curl_init();
$timeout = 0;
curl_setopt($curl, CURLOPT_URL, $link);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout);
$buffer = curl_exec($curl);
curl_close($curl);
return $buffer;
} elseif (function_exists('file_get_contents')) {
$buffer = file_get_contents($link);
return $buffer;
} elseif (function_exists('file')) {
$buffer = implode('', @file($link));
return $buffer;
} else {
return 0;
}
}
then I pass the url as a parameter:
$url = "https://graph.facebook.com/oauth/access_token?client_id=$client_id&client_secret=$client_secret&type=client_credentials&redirect_uri=http://www.mywebsite.com/facebook/&scope=email,offline_access";
echo get_contents($url);