I am using Google Photos API. As mentioned in API i stored refresh token for the next use after token expires. After 1 hour i am requesting to refresh client it produces error
"error": "invalid_grant", "error_description": "Token has been expired or revoked."
Here is my code:
$_SESSION['credentials'] = new UserRefreshCredentials(
$scopes,
[
'client_id' => $clientId,
'client_secret' => $clientSecret,
'refresh_token' => $refreshToken
]
);
$photosLibraryClient = new PhotosLibraryClient(['credentials' => $_SESSION['credentials']]);
UserRefreshCredentials
orPhotosLibraryClient
? – Jenea Vranceanu