-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unresponsive after some time #24
Comments
I doubt it would be token expiration, as the default and maximum expiration duration is 1 hour (though the documentation confirming this has disappeared). You should experience multiple refresh cycles in a 2-3 days period. If you think the module could be the cause, you can try setting the DEBUG variable to "google-oauth-jwt". With this, all authentication calls will be logged so you can diagnose a bit further. Example:
|
It is definitely more than an hour but I found today that it is less than 20 hours too. I will try setting the debug variable. But this is what documentation of Does it not obtain new token automatically ? I am using requestWithJWT request object. And if it doesn't obtain new token automatically, why does server restart help ? |
I have restarted the server with debug log enabled. I see that JWT token is requested only for the first request, after that it is reused. Token's TTL is 1 hour, and after that I think it is not requested again. Looks like here is the problem: https://github.com/extrabacon/google-oauth-jwt/blob/master/lib/token-cache.js#L27 Token is requested only if it hasn't been requested yet for the given email id. After that, it is always used from the cache without checking TTL. If you agree, can you please fix it, I can send a PR too if that works. |
After inspecting more, I find that there is code to handle expired token and request new one. In my debug logs, I see that after one hour, token is refreshed.
I am going to keep an eye on why after a day or two it stops working. |
Token is refreshed automatically when you use the If you find an issue, I will gladly help. |
I have a solution for this issue. Land here from |
Hi,
I am running into an issue and seeking some help here. I am able to authenticate successfully and talk to google APIs (calendar v3 apis). But after 2-3 days things stop working. Request to google APIs never finishes and it just keeps waiting.
But if I restart my node server, everything is back to normal and I start getting response from google APIs, but it starts to hang after 2-3 days again (unless I restart my node server).
Any clue on how to fix it ? Does it has to do with token getting expired after few days and somehow restarting the server fixes it ?
Here is the code to talk to google apis:
The text was updated successfully, but these errors were encountered: