2
offline_access가 더 이상 사용되지 않는다는 것을 알았으니 이제는 그 허가없이 오래 살아있는 액세스 토큰을 어떻게 얻을 수 있는지 말해 줄 수 있습니까?액세스 토큰의 유효성을 확장하는 방법은 무엇입니까?
offline_access가 더 이상 사용되지 않는다는 것을 알았으니 이제는 그 허가없이 오래 살아있는 액세스 토큰을 어떻게 얻을 수 있는지 말해 줄 수 있습니까?액세스 토큰의 유효성을 확장하는 방법은 무엇입니까?
base_facebook.php에 다음 기능을 추가하여 액세스 토큰을 확장 할 수 있습니다.
// 토큰 값을 확장하기위한 확장 기능.
공공 기능 getExtendedAccessToken() {
try {
$access_token_response =
$this->_oauthRequest(
$this->getUrl('graph', '/oauth/access_token'),
$params = array( 'client_id' => $this->getAppId(),
'client_secret' => $this->getApiSecret(),
'grant_type'=>'fb_exchange_token',
'fb_exchange_token'=>$this->getAccessToken(),
));
} catch (FacebookApiException $e) {
return false;
}
if (empty($access_token_response)) {
return false;
}
$response_params = array();
parse_str($access_token_response, $response_params);
if (!isset($response_params['access_token'])) {
return false;
}
return $response_params['access_token'];
}
확인이 : http://stackoverflow.com/a/9712663/122978 – greut