-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Token is not getting refreshed after its expired after around 1 hour #109
Comments
Hey, thanks for the detailed ticket!
Yes, this indeed seems to be the case. I'll be grateful if you can create a PR with a fix 🙏 and I'll go ahead and create a new release once you open the PR and it's merged. Thanks! |
Hey, @omarryhan @praveen-elastic I've raised a PR which fixes this issue for service-accounts. |
Thank you so much @neel004! I've just released v4.4.0 p.s. I think right now we're refreshing tokens on every next page request, ideally, we should check if the access token is expired first to avoid the extra network call. We probably need to work on the Auth.ServiceAccountManager.refresh method. But I guess this isn't urgent, hence why I merged and released it. |
Thanks for the quick merge, I'll raise a PR once I have proper fix ready, till then we can keep the issue open. |
Hey @omarryhan , on a totally different note, is there a way to get the object data in binary or encoded form? I'm encountering |
@omarryhan Thinking about the authentication with ApiKeyManager, should the package raise the error it encounters for expired token or you want it to be handled differently? |
Ah makes sense. I'm not sure what the current behaviour is. Also, I was under the impression that API keys never expire? |
Ohh, Got it 👍🏻 . |
I guess it's safe to close this issue now? :) |
I'm working on implementation for other authentication methods, as planned before. Once done we can close the issue 😃. |
Right! My bad. Thank you for your contributions and work! |
Hello @omarryhan, began work on this. Could you could assist me with this tiny problem? |
Sure, happy to help. The purpose of giving the option to pass user creds for only one request is for applications/library users who are handling user creds of multiple users. It would be inconvenient if the Aiogoogle class stores the user creds in the instance's state if it will change with every call anyway. I recall that the problem was only with pagination, no? If you set user creds as an attribute in the aiogoogle instance, then it should automatically check if the access token is expired and refresh. That only doesn't happen in pagination, right? |
@omarryhan Yes, This is the case for individual requests. So, as a solution to it, I was thinking of introducing the |
Thanks for the clarification @neel004! I think we should avoid setting user_creds to auth manager if the user didn't explicitly do so when instantiating the auth manager, otherwise, it will be useless to allow one off user_creds requests. If it will be easy, maybe we can somehow pass the user_creds object like we pass the auth manager? |
Got your concern about allowing one-off user_creds 👍🏻 .
🆒 I'll do that. |
Issue: I've been executing a script to fetch all the objects from cloud storage. There are around a lot of objects present in the bucket.
Observation: The script fetches half of the objects in around 1 hr and then raises the below-mentioned error.
Traceback:
Traceback (most recent call last):
Question:
Is there any other way to reset the access token present in the session_factory's send() method? or am I missing a step?
code snippet:
Possible issue: When pagination starts, if there are more pages to go through, the package fails to look for the validity of the access_token.
The text was updated successfully, but these errors were encountered: