GitHub OAuth error


I’m getting this error: 'object(stdClass)#1 (1) { [“error”]=> string(9) “Not Found” } '.

I’m making “Log in with GitHub” system with PHP and that’s what I got.



	$code = $_GET['code'];

	if($code == "")
		header('Location: http://localhost:80/user/');

	$CLIENT_ID = "private";
	$CLIENT_SECRET = "private";
	$URL = "";

	$postParams =
		'client_id' == $CLIENT_ID,
		'client_secret' == $CLIENT_SECRET,
		'code' == $code
	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, $URL);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
	$response = curl_exec ($ch);


	$data = json_decode($response);

	echo '<br/>';


Thanks in advance.

Unfortunately, we won’t be able to help you debug your PHP script. But if you can supply a minimal repro case using a tool like curl or HTTPie, giving us the command you used (with any security tokens redacted, of course) and the response you received, we can help debug from there.

Let us know!