jasonrollins / shareplum

Pythonic SharePoint
MIT License
179 stars 96 forks source link

401 Client Error because of a Site redirect. #125

Open GilbN opened 4 years ago

GilbN commented 4 years ago

Version: 0.5.1

So it looks like my organization has added a new redirect when we try and do to https://xxxxx.sharepoint.com It sends the user to https://xxxxx-intranet-redirect.azurewebsites.net/ then to a sharepoint site https://xxxxxx.sharepoint.com/sites/Group-Intra-Group

Is there any way around this?

Exception

Traceback (most recent call last):
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\shareplum\request_helper.py", line 17, in post
    response.raise_for_status()
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://XXXXXXX-intranet-redirect.azurewebsites.net/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:/Automatisering/novek_automation/scripts/from shareplum import Site.py", line 4, in <module>
    authcookie = Office365('https://XXXXXX.sharepoint.com/', username='user.name@organization.com', password='XXXXXXXXX').GetCookies()
  File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python38-32\lib\site-packages\shareplum\office365.py", line 90, in get_cookies
    response = post(requests, url, data=sectoken)
  File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python38-32\lib\site-packages\shareplum\request_helper.py", line 20, in post
    raise ShareplumRequestError("Shareplum HTTP Post Failed", err)
shareplum.errors.ShareplumRequestError: Shareplum HTTP Post Failed : 401 Client Error: Unauthorized for url: https://XXXXXX-intranet-redirect.azurewebsites.net/
jasonrollins commented 3 years ago

Sorry, I'm not really sure.