Skip to content

Sharepy auth key error when accessing cookies dictionary #83

Description

@alexilyin1

Our team had been using sharepy to read/write files to our org's Sharepoint site for multiple years now. Out of the blue, sharepy auth started to fail on the following code blocker

sharepy.connect("companyname.sharepoint.com", username=username, password=password) with the following traceback

File "/Users/alex.ilyin/.pyenv/versions/dwh/lib/python3.10/site-packages/sharepy/session.py", line 15, in connect
    return SharePointSession(site, auth=autoauth)
  File "/Users/alex.ilyin/.pyenv/versions/dwh/lib/python3.10/site-packages/sharepy/session.py", line 61, in __init__
    self.auth.login(self.site)
  File "/Users/alex.ilyin/.pyenv/versions/dwh/lib/python3.10/site-packages/sharepy/auth/spol.py", line 26, in login
    self._get_cookie()
  File "/Users/alex.ilyin/.pyenv/versions/dwh/lib/python3.10/site-packages/sharepy/auth/spol.py", line 60, in _get_cookie
    cookie = self._buildcookie(response.cookies)
  File "/Users/alex.ilyin/.pyenv/versions/dwh/lib/python3.10/site-packages/sharepy/auth/spol.py", line 91, in _buildcookie
    return 'rtFa=' + cookies['rtFa'] + '; FedAuth=' + cookies['FedAuth']
  File "/Users/alex.ilyin/.pyenv/versions/dwh/lib/python3.10/site-packages/requests/cookies.py", line 334, in __getitem__
    return self._find_no_duplicates(name)
  File "/Users/alex.ilyin/.pyenv/versions/dwh/lib/python3.10/site-packages/requests/cookies.py", line 413, in _find_no_duplicates
    raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
KeyError: "name='rtFa', domain=None, path=None"

Anyone have background on this error?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions