0
이 코드를 사용하여 access token
을 얻으 려하지만 어떤 성공도 얻지 못하고 있습니다. 모든 컬링 작업을 점검했는데 모든 것이 정확하지만 여전히 토큰을 얻을 수 없습니다. 당신이 당신의 URL에 HTTPS를 사용하는 경우액세스 토큰을 얻을 수없는 이유는 무엇입니까?
this is OAuth2 Guidlines from Google
$data_string = "code=" . $_REQUEST['code'] . "&client_id=" . $client_id . "&client_secret=" . $client_secret . "&redirect_uri=" . $redirect . "&grant_type=authorization_code";
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'https://accounts.google.com/o/oauth2/token');
curl_setopt($ch,CURLOPT_POST,TRUE);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-type: application/x-www-form-urlencoded'));
curl_setopt($ch,CURLOPT_POSTFIELDS,$data_string);
$response = curl_exec($ch);
curl_close($ch);
//$data = json_decode($response);
print_r($response);
토큰, 모든 것을 얻기하지 않는 경우 좋지 않다. "토큰을 얻을 수 없다"는 의미를 명확히 할 수 있습니까? 방문자는 결코 귀하의 사이트로 리디렉션되지 않습니다? 리디렉션은 토큰없이 발생합니다. 예외가 보입니까? 응답이 비어 있습니까? – Basic