sharepy icon indicating copy to clipboard operation
sharepy copied to clipboard

Support different sites in Sharepoint, requires full site URL when fetching digest

Open Jamie- opened this issue 2 years ago • 1 comments

Most endpoints in the SPOL auth class appear to need just the Sharepoint FQDN (e.g. mycompany.sharepoint.com) However for the digest to be valid when working with sites (e.g. mycompany.sharepoint.com/sites/MySite), the digest needs to be fetched for the correct site.

With these changes, when working with sites, connect using e.g.

sharepy.connect("https://mycompany.sharepoint.com/sites/MySite")

Although the code is robust to with/without https?:// and with/without trailing /.

Without these changes, when trying to upload a file to a Sharepoint site (e.g. mycompany.sharepoint.com/sites/MySite) I get the error:

The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.

Jamie- avatar Sep 20 '23 14:09 Jamie-

This PR fixed an issue I was having as well. Any interest in adding this work @JonathanHolvey?

dltacube avatar Jan 31 '24 16:01 dltacube