Hi all, I'm trying to upload a file from my computer to my Microsoft SharePoint site using a python script.
I have a SharePoint site created through free MS teams org.
But I got an "Exception error" in the "authcookie" line.
My site_name is like 'https://myorg.sharepoint.com' and base_path is like 'Myorg-channel' (ie https://myorg.sharepoint.com/sites/Myorg-channel)
And I'm using MS Team admin user email and password who has the access to this channel.
Code I tried-
I have a SharePoint site created through free MS teams org.
But I got an "Exception error" in the "authcookie" line.
My site_name is like 'https://myorg.sharepoint.com' and base_path is like 'Myorg-channel' (ie https://myorg.sharepoint.com/sites/Myorg-channel)
And I'm using MS Team admin user email and password who has the access to this channel.
Code I tried-
import requests from shareplum import Office365 username = '[email protected]' password = 'adminPassword' site_name = 'https://myorg.sharepoint.com' base_path = 'Myorg-channel' # Obtain auth cookie authcookie = Office365(base_path, username=username, password=password).GetCookies()Error message-
Error:Exception: ('Error authenticating against Office 365. Was not able to find an error code. Here is the SOAP response from Office 365', b'<?xml version="1.0" encoding="utf-8"?><S:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:S="http://www.w3.org/2003/05/soap-envelope"><S:Header><wsa:Action S:mustUnderstand="1" wsu:Id="Action">http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue</wsa:Action><wsa:To S:mustUnderstand="1" wsu:Id="To">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsse:Security S:mustUnderstand="1"><wsu:Timestamp wsu:Id="TS" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsu:Created>2020-06-05T12:01:00.5972083Z</wsu:Created><wsu:Expires>2020-06-05T12:06:00.5972083Z</wsu:Expires></wsu:Timestamp></wsse:Security></S:Header><S:Body xmlns:S="http://www.w3.org/2003/05/soap-envelope"><wst:RequestSecurityTokenResponse xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust"><wsp:AppliesTo><wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Address>Myorg-channel</wsa:Address></wsa:EndpointReference></wsp:AppliesTo><psf:pp xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault"><psf:reqstatus>0x8004882c</psf:reqstatus><psf:errorstatus>0x80045b00</psf:errorstatus></psf:pp></wst:RequestSecurityTokenResponse></S:Body></S:Envelope>')
Appreciate it if someone can help to rectify this error.