0

I try to access SharePoint via a Python Script, because I want to download and update a list in Sharepoint.

I use shareplum to access, but I get an:

raise Exception('Error authenticating against Office 365. Error from Office 365:', message[0].text) Exception: ('Error authenticating against Office 365. Error from Office 365:', 'AADSTS53003: Access has been blocked by Conditional Access policies. The access policy does not allow token issuance.

Heres my simple Code:

from shareplum import Site
from shareplum import Office365

authcookie = Office365('https://example.sharepoint.com', username='example@mail.com', password='Password').GetCookies()
site = Site('https://example.sharepoint.com/sites/example-site', authcookie=authcookie)
sp_list = site.List('list name')

Any ideas?

WoodlegDev
  • 11
  • 1
  • 2

1 Answers1

0

Recommend you to get client id and secret

then access sharepoint using https://github.com/vgrem/Office365-REST-Python-Client/tree/master/examples/sharepoint

Karan Bhandari
  • 370
  • 3
  • 12