Did anyone found a way to refresh a token with the Weibo api ?
I implemented an authentication on my website in order to get the user token but, in the JSON the API returns, there is no "refresh_token" field. Missing this information I can't refresh the token of my app users.
I need this token to be auto-refreshed once the user has been authenticated one time because I use it in a CRON job to get the feed of the registered user and save it in database.
I use the facebook sdk provided in Weibo documentation https://github.com/xiaosier/libweibo
And my authentication code look like that:
$o = new SaeTOAuthV2( WEIBO_APP_API_APP_KEY , WEIBO_APP_API_SECRET );
$code_url = $o->getAuthorizeURL( WEIBO_APP_CALLBACK_URL );
$error_message = '';
if (isset($_GET['code']) && empty($val)) {
$keys = array();
$keys['code'] = $_GET['code'];
$keys['redirect_uri'] = WEIBO_APP_CALLBACK_URL;
try {
$token = $o->getAccessToken( 'code', $keys );
//$token['refresh_token_at'] = strtotime('+2 week');
} catch (OAuthException $e) {
$error_message = pll__('There was a problem during connection process. Please try again or contact the website administrator');
}
}
The json that the API returns :
{
"access_token": "2.00pxxxxxxxxxxxxxxxxxxxxxxx",
"remind_in": "157679999",
"expires_in": 157679999,
"uid": "65xxxxxxx",
"isRealName": "true"
}
Do I miss something in the API Documentation ? Or is this a particular implementation of the Oauth pattern where you've got to get your refresh token by another way ? I searched a lot in the documentation and can't find a clue about that.
There are something disturbing, the timestamps for remind_in and expires_in give the following date when converted to human readable date : 1974-12-30 23:59:59