JonathanHolvey / sharepy

Simple SharePoint authentication for Python
GNU General Public License v3.0
175 stars 52 forks source link

AttributeError: 'SharePointSession' object has no attribute 'cookie' #43

Closed kuharan closed 3 years ago

kuharan commented 4 years ago
Traceback (most recent call last):
  File "xxx\lambda_function.py", line 66, in <module>
    uploadToSharepoint(SPUrl, username, password, siteName, libraryName, path)
  File "xxx\lambda_function.py", line 14, in uploadToSharepoint
    s = sharepy.load()
  File "xxx\sharepy\session.py", line 27, in load
    if session._redigest() or session._spauth():
  File "xxx\sharepy\session.py", line 124, in _redigest
    response = requests.post("https://" + self.site + "/_api/contextinfo", data="", headers={"Cookie": self.cookie})
AttributeError: 'SharePointSession' object has no attribute 'cookie'

I am getting this error while executing.

JonathanHolvey commented 4 years ago

Can you post the version of SharePy you're using and the code you're running that causes the error?

kuharan commented 4 years ago

I replaced the headers and it worked. But I want to know if it is blocking an SSO authenticated sign in. Have you tested in an SSO environment?

JonathanHolvey commented 4 years ago

No, I haven't tested in a SSO environment. There is an upcoming release of SharePy that is intended to support a wider variety of auth setups. Perhaps you could try using that? https://github.com/JonathanHolvey/sharepy/tree/release-2.0.0-beta

I replaced the headers and it worked.

What do you mean when you say this?