i managed to used the Auth2 with LinkedIn but after having some issue i found out that Oauth2.php need some changes for it to work with LinkedIn. Below is the changes required at function httpPost:
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
if not it will get missing parameter error after user has click allowed in LinkedIn.