I try to authenticate with LinkedIn API with OAuth2. Code:
if ((isset($_GET["code"])) AND (isset($_GET["state"]))) {
$code = $_GET["code"];
$state = $_GET["state"];
$curl_request = curl_init();
curl_setopt_array($curl_request, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => "https://www.linkedin.com/uas/oauth2/accessToken",
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => array(
grant_type => "authorization_code",
code => "$code",
redirect_uri => "SECRET",
client_id => "SECRET",
client_secret => "SECRET"
)
));
$curl_result = curl_exec($curl_request);
var_dump($curl_result);
}
I got this message:
string(153) "{"error_description":"missing required parameters, includes an invalid parameter value, parameter more than once. : client_id","error":"invalid_request"}"
Could you help m?