I know this is old by had to deal with similar problem and have 2.5 solutions.
This solution is specifically for the federated logins.
Simple hacky solutions works like a magic for files :)
On Windows 10 - the silliest solution:
- First login to your sharepoint with Internet Exploer/Edge. Must be IE/Edge.
- Then in Start-> Run dialog or any Windows Explorer address bar do this:
\\@SSL\rest\of_the\path
. Note @SSL
after host name.
- Make sure to replace all the forward slashes with backslashes.
- This makes sure that your login credentials are captured by the system.
- Then navigate to "This PC", menu "Computer->Map Network Drive" and paste either that same path from above or your normal URL
https:///rest/of_the/path
into Folder
text field of Map Network Drive.
- Now you have Sharepoint folder mapped as regular network drive
X:\
! Which allows you to treat is just as normal file system folder from any program or programming language.
- This solution uses WebDav WebClient and by default you will hit a 50MB limit! Worry not follow these steps to release yourself from the shackles of the silly limit.
Simple Hacky.
- Open your browsers and open the 'Developer Tools'.
- Navigate to 'Network' tab of 'Developer Tools'
- With Network tab open login to your sharepoint site.
- Click on any of the requests and you shall see that every single
Request Header
has a Cookie
with FedAuth=some_very_long_base64_encoded_xml_struct;rtFa=something_else_long
.
- Basically you need these two cookies
FedAuth
and rtFa
.
- Now with every GET POST (curl, wget etc) request to the Sharepoint just add a new header
Cookie
with the value FedAuth=;rtFa=
.
Programmatic-hacky (example in python on windows), essentially #2 but cookie manipulation all done programmatically.
- We shall steal the cookie directly from the kid... I mean from the Chrome browser.
- Navigate to your Sharepoint With the chrome browser and perform all the necessary login actions.
- Steal the cookie gist. Plagiarized from here.
- Use the cookie gist.
- REST of Sharepoint REST API wisdom here and ref here.
Finally open a beer enjoy your day.