I'm working on a project which needs me to get onedrive files shared with a user. I'm using application permissions and have set all the required permissions and also consented according to the document on: https://docs.microsoft.com/en-us/graph/api/drive-sharedwithme?view=graph-rest-1.0
I tried this get call: https://graph.microsoft.com/v1.0/users/{User-Principal-Name}/drive/sharedWithMe
But the response I'm getting is empty.
While using delegated permissions and with below get call: https://graph.microsoft.com/v1.0/me/drive/sharedWithMe
I'm able to list all the files shared with the user.
Am I missing out something here? Any help will be welcomed!