Repository navigation
Token for multiple request #81
Description
Activity
Not the maintainer, but more code might help. The construction of your auth client at least?
Hi, yes, sorry, here's the code: https://gist.github.com/anddimario/6338925
Sometimes it works without problems, i've tried to set a single client and an oauth for each request, but it seems not work.Thanks for your time.
Best regards.Is there any chance, this problem is occurring during token refresh? There is a racing condition in this case if there are multiple token refreshing requests are sent out.
Hi, i'm looking for use something with async, what do you think it could be the best method to do multiple request?
I've tried the batch system but there are some problems.Thanks for your time.
Best regards.Google implements OData's batch protocol which cant be consumed by the native HTTP implementation of node which leads to implementing and http client in pure JS or implementing a native OData client. Both are not worth the effort, so I'd suggest using async.
What you can do to avoid your problem, before starting the requests check the expiration date of the token and retrieve a new access token. I'll try to address this in the lib, but temporarily you can solve the problem by making sure your access token is not expired before starting the requests.
Hi, i'm usign this link to test my token: https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=
I saw that tokens aren't expired, but the request gave back errors again and the expire time are not refreshed.
I've tested the tokens after and they work.
Could it be some problems with refresh token in oauth method for client?Thanks for your time.
Best regardsIs it possible for to dump the request bodies and headers so I can try to
reproduce your problem? My hypothesis about racy token refreshment is
probably wrong. Even though it's racy, the newly generated access tokens
don't invalidate the previous ones.On Tue, Sep 3, 2013 at 11:03 AM, anddimario [email protected]:
Hi, i'm usign this link to test my token:
https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=
I saw that tokens aren't expired, but the request gave back errors again
and the expire time are not refreshed.
I've tested the tokens after and they work.
Could it be some problems with refresh token in oauth method for client?Thanks for your time.
Best regards—
Reply to this email directly or view it on GitHubhttps://github.com//issues/81#issuecomment-23698595
.Hi, i've created a function to refresh token function and it seems that the principal problem disappears, but i've the resource limit problem, i'm using sleep too, but it seems that client make all request at the same time.
Hi - I recently used apache bench to load test (100 total reqs, 10 at a time) an API endpoint that uses the client to call a Google API. The benchmark only got to request 32 before node threw:
[Error: No access or refresh token is set.]
at OAuth2Client.request (/webapp/node_modules/googleapis/lib/auth/oauth2client.js:184:11Any info I can contribute to debug this?
Just released 1.0.3 which will likely address this issue. The access token will be refreshed prior to initial request if has expired or is missing and you have a refresh token set. If the request fails due to a missing, invalid, or revoked access token, we will no longer attempt to refresh and re-attempt the request.
https://github.com/google/google-api-nodejs-client/releases/tag/1.0.3
- addedtriage meI really want to be triaged.I really want to be triaged.🚨This issue needs some love.This issue needs some love.
on Apr 6, 2020
Hi, i'm creating a batch script that execute requests with async, there are about 20 requests, and on client request i've this error:
It's a random error and not on a specific request and i think it's something like a timeout on oauth.
Here's the code for a request:
Have you some suggestions about this problem?
Thanks for your time.
Best regards