diff --git a/auth/linkedin/index.php b/auth/linkedin/index.php index 8e76c27..2762592 100644 --- a/auth/linkedin/index.php +++ b/auth/linkedin/index.php @@ -6,4 +6,26 @@ * Time: 15:17 */ -print_r($GLOBALS); \ No newline at end of file +// https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=81cc4t9fuu9bpu&redirect_uri=https%3A%2F%2Ffengyuexingzi.top%2Fauth%2Flinkedin&state=987654321&scope=r_basicprofile + +$url = "https://www.linkedin.com/oauth/v2/accessToken"; + +$data = array( + 'grant_type' => 'authorization_code', + 'code' => $_GET['code'], + 'redirect_uri' => 'https://fengyuexingzi.top/auth/linkedin', + 'client_id' => '81cc4t9fuu9bpu', + 'client_secret' => 'GdY3ZO8LAHn8y4tX', +); + +$ch = init($url); +curl_setopt($ch,CURLOPT_POST,true); +curl_setopt($ch, CURLOPT_POSTFIELDS, build_query($data)); +curl_setopt($ch, CURLOPT_TRANSFERTEXT, true); +curl_setopt($ch, CURLOPT_TIMEOUT, 5); +curl_setopt($ch, CURLOPT_HEADER, false); +$result = curl_exec($ch); +$info = curl_getinfo($ch); +curl_close($ch); +print_r($info); +var_dump($result); \ No newline at end of file