Open nbtk123 opened 6 months ago
Hello, this could be due to a limitation on the token lifetime caused by CAE, https://github.com/Azure/azure-sdk-for-python/blob/48cdbb2d3f6422a74faca22a12adb41c26dd475e/sdk/core/azure-core/azure/core/credentials_async.py#L21, To fix this, we have on our side put the flag to true, so tokens can live for upto 24 hours.
Upgrading to the latest release of https://github.com/microsoft/kiota-authentication-azure-python/releases/tag/v1.1.0 should fix this
Hello,
I have a scenario, where I use GraphServiceClient based on ClientSecretCredential to paginate over some site-list-items resources, and after an hour or so, the aiohttp session is becoming None.
Excerpt from the exception:
The pagination is done inside a loop, using the
odata_next_link
which is returned with the response, thus requesting the next page.Eventually, after about an hour, the SDK tries to renew the token but fails with the exception, described further below.
I dig deep into the source code to detect if I did something wrong, but I didn't find anything. I have a few thoughts but I don't want to confuse you guys or mislead, so I'll just describe my code and the full exception stack trace.
My setup
Python versoin:
3.11.5
msgraph version, from pdm lock file:
My code flow
My code flow, in short, is as such:
The exception stack trace
And the exception I receive, seems to be during the token "refresh". I double-quote "refresh" because the SDK doesn't use the refresh token but just requests a new one using the
obtain_token_by_client_secret
function.Would love you help on this!
Thanks!