-
Notifications
You must be signed in to change notification settings - Fork 11
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
Investigate whether the async credentials should be closed by this library or by the caller #365
Comments
@baywet is this closed? |
sure, it might be a problem in some scenarios (singleton instances of credentials etc...) but we'll wait for customers to report something before spending mort time on this first. |
Hello, I would like to ask to reopen this issue, as it seems to manifest e.g. in microsoftgraph/msgraph-sdk-python#505 , preventing long living instances of My suggestion would be to leave closing the credential entirely up to the user. For them it would then be easy to control the lifecycle of their credential instance by using it as context manager. Closing the credential inside the library means that there is no way for the user to keep client instances alive for longer than one token lifetime, or to reuse the same credential to instantiate multiple clients. At least in the case of using |
Hi @baywet, hope you are well, I have the same issue with
What other approach should I be using if this is not correct? |
@samwelkanda can you follow up on this one when you have some time please? |
@Christiaan-Mathu My current workaround is to prevent the credential from getting closed by the GraphServiceClient using a custom credential implementation. I basically derive a custom class from the async credential class I want to use (here This seems to work fine, I had no issues with this approach so far. |
Originally posted by @baywet in microsoft/kiota-authentication-azure-python#45 (comment)
The text was updated successfully, but these errors were encountered: