assertion_node = dom.getElementsByTagNameNS("urn:oasis:names:tc:SAML:1.0:assertion", 'Assertion')[0].toxml()
See original GitHub issueI’m trying to connect to my organization’s SharePoint (end purpose is to be able to read a list within a folder) I tried the following:
from office365.sharepoint.client_context import ClientContext
from office365.runtime.auth.user_credential import UserCredential
site_url = "https://domain.sharepoint.com/sites/folder"
ctx = ClientContext(site_url).with_credentials(UserCredential("username@domain.com", "password"))
web = ctx.web
ctx.load(web)
ctx.execute_query()
print("Web title: {0}".format(web.properties['Title']))
I’m getting these errors:
Traceback (most recent call last):
File “C:\Users\tdiacon\Pyproj\PySharePoint\project.py”, line 10, in <module>
ctx.execute_query()
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\runtime\client_runtime_context.py”, line 134, in execute_query
self.pending_request().execute_query()
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\runtime\client_request.py”, line 79, in execute_query
response = self.execute_request_direct(request)
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\runtime\odata\odata_request.py”, line 36, in execute_request_direct
return super(ODataRequest, self).execute_request_direct(request)
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\runtime\client_request.py”, line 91, in execute_request_direct
self.context.authenticate_request(request)
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\sharepoint\client_context.py”, line 230, in authenticate_request
self._auth_context.authenticate_request(request)
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\runtime\auth\authentication_context.py”, line 89, in authenticate_request
self._provider.authenticate_request(request)
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\runtime\auth\providers\saml_token_provider.py”, line 77, in authenticate_requ
est
self.ensure_authentication_cookie()
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\runtime\auth\providers\saml_token_provider.py”, line 84, in ensure_authentica
tion_cookie
self._cached_auth_cookies = self.get_authentication_cookie()
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\runtime\auth\providers\saml_token_provider.py”, line 97, in get_authenticatio
n_cookie
token = self._acquire_service_token_from_adfs(user_realm.STSAuthUrl)
File “C:\Users\tdiacon\Pyproj\PySharePoint\venv\lib\site-packages\office365\runtime\auth\providers\saml_token_provider.py”, line 140, in _acquire_service
_token_from_adfs
assertion_node = dom.getElementsByTagNameNS(“urn:oasis:names:tc:SAML:1.0:assertion”, ‘Assertion’)[0].toxml()
IndexError: list index out of range
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:15
Top Related StackOverflow Question
Hi , Do we have a solution to connect using User credentials. ? am using Office365-REST-Python-Client-2.3.13 and still seeing this issue while connecting using User Credentials.
Please find link below. https://github.com/vgrem/Office365-REST-Python-Client/issues/333