Starting off on a personal project, I'm able to successfully create an app in the Azure AD portal and am able to log in using the Python flow described in https://learn.microsoft.com/en-us/graph/tutorials/python?tabs=aad&tutorial-step=3, but am unable to then use the GraphServiceClient's me.todo.lists.get() to list the tasks in my To-Do account. The result is a 401 APIError with message: None
, error: MainError(additional_data={}, code='UnknownError', details=None, inner_error=InnerError(additional_data={},
etc, essentially containing no data beyond the datetime I made the call and the request ID. This is a delegated process (by my understanding), and I have Tasks.ReadWrite in my scope (and this did appear in the DynamicConsent dialogue as well). Where else should I look to debug this? The code is literally just:
self.device_code_credential = DeviceCodeCredential(client_id, tenant_id=tenant_id); self.user_client = GraphServiceClient(self.device_code_credential, self.graph_scopes); await self.user_client.me.todo.lists.get()