shareplum icon indicating copy to clipboard operation
shareplum copied to clipboard

Shareplum HTTP Post Failed : 403 Client Error: Forbidden for url:

Open eoq opened this issue 5 years ago • 2 comments

I have found that with our newest Office365 Sharepoint online sites we are getting 403 errors on POSTs during the authentication phase after a 302 redirects to / which shareplum is bombing out on. Subsequents GETs work in the session and everything seems to work if we allow the session to continue. Our older sites redirect as well but allows the GET on / and the POST eventually returns a 200 and all is happy.

I looked at the sharepy github project to compare and they seem to ignore the 403 errors and just do a( requests.get("https://" + self.site + "/_api/web", headers={"Cookie": cookie})) to test for a 200 to declare success. https://raw.githubusercontent.com/JonathanHolvey/sharepy/master/session.py

Again, the workaround is to comment out response.raise_for_status() in the post method in request_helper.py but that is probably not a good longterm solution.

I am willing to help diagnose more but not sure how to proceed.

Ed

older_sharepoint_flow.txt newer_sharepoint_flow.txt

eoq avatar May 30 '20 19:05 eoq

I just ran into this same issue with o365.

Also using the workaround described above ^^...

austinnichols101 avatar Sep 29 '20 19:09 austinnichols101

Same here, the workaround worked, but would be nice to get a proper fix for the longterm if thats even possible

m-inwards avatar Feb 27 '22 21:02 m-inwards