assertion_node = dom.getElementsByTagNameNS("urn:oasis:names:tc:SAML:1.0:assertion", 'Assertion')[0].toxml()

See original GitHub issue

I’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:open
  • Created a year ago
  • Reactions:1
  • Comments:15

github_iconTop GitHub Comments

2reactions
Madhu419commented, Jun 28, 2022

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.

0reactions
Dhyanesh97commented, Sep 7, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Assert | Node.js v19.3.0 Documentation
For example, assert.deepEqual() will behave like assert.deepStrictEqual() . In strict assertion mode, error messages for objects display a diff. In legacy ...
Read more >
XML DOM getElementsByTagNameNS() Method - W3Schools
The getElementsByTagNameNS() method returns a NodeList of all elements with the specified name and namespace. Syntax. getElementsByTagNameNS(ns,name). Parameter ...
Read more >
console.assert() - Web APIs | MDN
The console.assert() method writes an error message to the console if ... A JavaScript string containing zero or more substitution strings.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found