Closed rbaenar closed 6 years ago
This error is being thrown because the saved tokens in token.json
doesn't contain a refresh_token
, which is needed to refresh the access token after it's expired. At the moment the code isn't checking that a refresh token exists before it attempts to refresh the access token, nor handling the case when one doesn't exist. I'll put together a PR to fix this.
The code from the developer contain a bug to handle the refreshtoken as today 9 September 2018. i already fix the solution for this... you must save 2 location for token
hope this help...
How long can you solve this problem?
Almost 2 day and 2 night to figured it out :( the example on the quickstart is not good example.. because as google developer, the dev should test before put at the website as example.. now many newbie cannot start with quickstart hehe...
😂😂😂 I'm looking forward about that. Because I'm a newbie so impatient to do something that is my first small project...😁😁
Đăng Nam
Vào 16:31, T.3, 11 Th9, 2018 Syed Muhammad Bin Syed Hussin < notifications@github.com> đã viết:
Almost 2 day and 2 night to figured it out :( the example on the quickstart is not good example.. because as google developer, the dev should test before put at the website as example.. now many newbie cannot start with quickstart hehe...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gsuitedevs/php-samples/issues/16#issuecomment-420209877, or mute the thread https://github.com/notifications/unsubscribe-auth/AkkcEF1zHvu_bgLyrR-WEO949Hdh1aMTks5uZ4L1gaJpZM4VtuOU .
I pushed out some new code that handles this case better. Please try that new code and let me know if you still have a problem.
is it auto refresh-token for my apps or I have to copy the authenication from the warn on the CMD?
if I wanna auto the refresh-token, do I need some file to get that?
Hyperaktiv, do u already test the code? Suppose the code from eric now it will auto refresh the new token when reach after 3600 second..
ah, my fault, I've not read carefully.. Sorry Thank you very much. Hope that I can keep in touch with you
No problem.. hope u can test the eric way, if any problem u can roger here, eric will fix the bug...
He utilizado el ejemplo de quickstart.php para Google Calendar y funciona todo correcto hasta que pasan algo más de dos horas y me devuelve un error al intentar refrescar el token al expirar.
He mirado en muchos foros y no funciona nada de lo que se indica.
Por favor, me puede ayudar.
Sample:
ERROR
`PHP Fatal error: Uncaught LogicException: refresh token must be passed in or set as part of setAccessToken in C:\www\medel\pru\vendor\google\apiclient\src\Google\Client.php:258 Stack trace:
0 C:\www\medel\pru\quickstart.php(51): Google_Client->fetchAccessTokenWithRefreshToken(NULL)
1 C:\www\medel\pru\quickstart.php(59): getClient()
2 {main}
thrown in C:\www\medel\pru\vendor\google\apiclient\src\Google\Client.php on line 258
Fatal error: Uncaught LogicException: refresh token must be passed in or set as part of setAccessToken in C:\www\medel\pru\vendor\google\apiclient\src\Google\Client.php:258 Stack trace:
0 C:\www\medel\pru\quickstart.php(51): Google_Client->fetchAccessTokenWithRefreshToken(NULL)
1 C:\www\medel\pru\quickstart.php(59): getClient()
2 {main}
thrown in C:\www\medel\pru\vendor\google\apiclient\src\Google\Client.php on line 258`
Actual Behavior
Steps to Reproduce the Problem
1.He seguido los pasos que se indican en la guía de Google (https://developers.google.com/calendar/quickstart/php)
Specifications
php -v
): PHP Vr. 7.2.6