Onedrive - get files (shared with user/followed by user)
Hello @vgrem @GitSumito , came across the issue https://github.com/vgrem/Office365-REST-Python-Client/issues/654
question on how to get the user_assertion for the below ? msal_app.acquire_token_on_behalf_of(user_assertion=id_token,scopes=["https://graph.microsoft.com/.default"])
Per the below link, it seems it needs user interaction to get it. Is that correct? https://github.com/Azure-Samples/ms-identity-python-on-behalf-of
Wondering if any way to get the files shared/followed by user for one drive, without user interaction ? Is this possible using the ConfidentialClientApplication with MSAL to get the token and use with these examples ?
app = msal.ConfidentialClientApplication(clientID, authority=authority, client_credential={"thumbprint": thumbprint, "private_key": cert})
result = app.acquire_token_for_client(scopes=scope)
Can these examples be updated to support the use case of an app accessing users drive items / shared items - via msal ConfidentialClientApplication, if that is possible ? https://github.com/vgrem/Office365-REST-Python-Client/blob/master/examples/onedrive/drives/list_followed_items.py https://github.com/vgrem/Office365-REST-Python-Client/blob/master/examples/onedrive/drives/list_shared_with_me.py
When I try the ClientCredential Flow as documented https://github.com/vgrem/Office365-REST-Python-Client/tree/master?tab=readme-ov-file#working-with-onedrive-and-sharepoint-v2-apis ,
and use it for the example https://github.com/vgrem/Office365-REST-Python-Client/blob/master/examples/onedrive/drives/list_followed_items.py
I get an error - Is this use case supported with the client credential flow ? Since I plan to have this functionality in a daemon web application, I assume I need to use the client credential flow.
office365.runtime.client_request_exception.ClientRequestException: ('BadRequest', '/me request is only valid with delegated authentication flow.', '400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/me/drive/following')
If not, How do we configure the delegated authentication flow to use with this ? I am using a MS Azure App with attached permissions.
@vgrem Can you kindly help on this. Thanks.