Forum Discussion
Python SDK keeps asking to log in when making multiple API requests
Hi all,
I'm currently working on an application that needs a lot of pdf files. I want to recursively traverse my Onedrive, including shared folders. While my python scripts works, I need to keep logging in after a few folders. I use the GraphServiceClient from the msgraph-sdk to create an acces token, which I use for making http requests with the Graph API.
My script checks all driveItems in the root folder, checks the driveId and itemId of each driveItem and recursively goes trough all the folders, to list all pdf files. It is working fine, up until I need to log in again and again, to register my device. This happens when I am traversing my shared folders, but I don't get access issues: I think it has to do with the API connection.
I don't think I exceed the API limits, but I do not have clue what it can be. Does someone else have had that problem, or can someone point me into the right direction to fix this issue?
Thanks a lot,
Ruben