How i can refresh token ? I use Google api with this token - it work but can't find how to refresh it, in this example we dont save expired time. I require
`access_type: offline `
then
$client = new Google_Client();
//$client->setClientId($GoogleClientId);
$client->setApplicationName($GoogleAppName);
$client->setClientId($this->user->getGoogleId());
$client->setAccessType('offline');
if token is valid i can work but when is expired i try
$token = [
'access_token' => $this->user->getGoogleAccessToken(),
'expires_in' => (new \DateTime())->modify('-1 year')->getTimestamp(),
];
i put this any date because in this example we don't save expired time
https://gist.github.com/danvbe/4476697
$client->setAccessToken($token);
if($client->isAccessTokenExpired()){
$refreshedToken = $client->refreshToken($client->getAccessToken());
here i have error
array:2 [▼
"error" => "invalid_request"
"error_description" => "Could not determine client ID from request."
]
There is HwiAuthBundle method to refresh token ? Why this not work with Google_Client refresh ?