I'm trying to use cURL to do facebook authentication and here's what I have:
$url = "https://graph.facebook.com/oauth/access_token";
$postString = "?client_id=$client_id&redirect_uri=$redirect_uri&client_secret=$client_secret&code=$code";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_FAILONERROR, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
//curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postString);
$response = curl_exec($curl);
but every time it just returns false.
I'm pretty new to using cURL so I could be making some beginner mistakes, but I'm confused as to why this isn't working at all.
Any help would be greatly appreciated!