Office365-REST-Python-Client icon indicating copy to clipboard operation
Office365-REST-Python-Client copied to clipboard

AttributeError: 'NoneType' object has no attribute 'text' : version 2.1.4

Open jainl03 opened this issue 3 years ago • 2 comments

I am trying to download the file from sharepoint for which I am authenticating using username and password.

Here is the code which I have tried:

sp_base = 'https://<company>.sharepoint.com/sites/test/'

from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
ctx_auth = AuthenticationContext(sp_base)
ctx_auth.acquire_token_for_user(username,password)  
context = ClientContext(sp_base, ctx_auth)


But when I run this I am getting this error :

return token.text AttributeError: 'NoneType' object has no attribute 'text'

jainl03 avatar May 25 '22 14:05 jainl03

Hi,

Probably your company has enabled a federated authentication with SAML. Mine did and I end up with the same error message.

Regards, Eric

edbmnt avatar Jun 29 '22 08:06 edbmnt

Did you manage to get around this issue Eric?

Paint32 avatar Jun 29 '22 17:06 Paint32

I am facing this issue when running from a Linux machine, from a windows Vm this is working as expected. Any updates

priyankajain1711 avatar Oct 17 '22 15:10 priyankajain1711