Using GraphAPI to access a folder on a remote customer OneDrive folder (Not just my own OneDrive)
Hi,
I am trying to write a small application that connects to a customer's OneDrive and folder, then conducts a dir-list on that folder and downloads files from his Drive, which I later process on my application.
I've followed the official instructions describing how to configure the customer's Azure Portal's Active Directory and register a new application with ApplicationID, ClientSecret and proper API Permissions (File.ReadWrite, File.ReadWrite.AppFolder) , then made my application use GraphAPI to authenticate using those identifiers, fetch an access-token and connect using rest-api POST operation, then connecting and using rest-api GET operation to conduct a dir-list.
To my surprise the dir-list returned the directories and files of my own Drive - and NOT the customer's Drive...I can see or download only files from my own Drive, and the customer never see any files I Upload to any directory (of my own Drive, it seems...even though I connected with the customer supplied AppID and ClientSecret)
What am I missing here? Why doesn't the dir-list return the client's Drive and directory content instead of my own Drive's?
p.s I know of an alternative way, to make the customer manually share a folder and send a link by email, which when manually opened and clicked maps his remote folder to my drive, I did manage to scan this mapped folder (which now appears on my Drive) using GraphAPI and download a file, however it feels awkward to have to relay on manual links creation and emails, and I doubt that's the proper way for an application to do it.
Any advise?