I am trying to connect to Sharepoint using the following code. It was working previously however it has suddenly stopped working, and is now showing the following error:
File "C:\Users\Documents\Anaconda2\lib\site-packages\office365\runtime\auth\saml_token_provider.py", line 67, in get_authentication_cookie
return 'FedAuth=' + self.FedAuth + '; rtFa=' + self.rtFa
TypeError: cannot concatenate 'str' and 'NoneType' objects
ctx_auth = AuthenticationContext(url)
if ctx_auth.acquire_token_for_user(username, password):
print("Authentication with SharePoint was successful: {0}".format(
ctx_auth.acquire_token_for_user(username, password)))
ctx = ClientContext(url, ctx_auth)
web = ctx.web
ctx.load(web)
ctx.execute_query()
print "SharePoint Site: {0}".format(web.properties['Title'])
else: print ctx_auth.get_last_error()
It fails on this line:
ctx.execute_query()