jasonrollins / shareplum

Pythonic SharePoint
MIT License
179 stars 96 forks source link

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

Open eoq opened 4 years ago

eoq commented 4 years ago

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

austinnichols101 commented 4 years ago

I just ran into this same issue with o365.

Also using the workaround described above ^^...

m-inwards commented 2 years ago

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