I have created an App in .NET 4.8 and I use WinSCP wrapper. During my tests, I was using my own OneDrive account. It worked great, I followed the instructions here (Connecting securely to Microsoft OneDrive with WebDAV). It works with or without MFA. Now, here is the tricky part. A friend of mine shared a folder on his One Drive and sent me an invitation. His invitation was mentioning a folder named (for example)
Shared_folder. I want to make my application connect and view/upload files to this folder. When I clicked his invitation, I saw that the CID on the One Drive URL was different than mine, which means that I have to use his CID as a root folder, but still use my own credentials to login. Based on these information, the login information and directories I should pass to the WinSCP wrapper should be:
- subfolder=Shared_folder (the folder name I got on the invitation email)
- password=my_password (or MFA password, depending on whether i have enabled it or not)
/MY_FRIENDS_CID/Shared_folderas Remote directory. Any ideas on how i should treat the connection to a Onedrive folder shared by others?
ps. When I used rootpath=/MY_FRIENDS_CID/Shared_folder, I get the same 404 error but with message "Error changing to /MY_FRIENDS_CID/Shared_folder". It seems to connect but fails to list folders. Could it be a directory access from my friends side?