Msgstr "Invalid verification code format." Facebook oauth error

I am starting to develop applications for Facebook. I'm stuck with an authentication problem, I'm 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 get this error: Msgstr "Invalid confirmation code format."

I have been trying to resolve this in the last three hours and have not received a result. I am trying to send this message to Google, but apparently it is not so popular.

Can you help?

Edit: I am using 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);

+5

All Articles