I'm trying to access an excel sheet to extract data, but it is on sharepoint which makes things a bit more complicated.
I'm using this code (snippet):
He also recommended I use make, but I prefer coding things myself, and I'm trying to use this code for a college project. I've not coded a lot with python at all, so I want to continue to use it to learn.
I'm using this code (snippet):
from office365.runtime.auth.authentication_context import AuthenticationContext from office365.sharepoint.client_context import ClientContext site_url = 'site_url' username = 'username' password = 'password' ctx_auth = AuthenticationContext(site_url) if ctx_auth.acquire_token_for_user(username, password): ctx = ClientContext(site_url, ctx_auth) web = ctx.web ctx.load(web) ctx.execute_query() print('Authenticated into SharePoint as:', web.properties['Title'])but I'm seeing:
Error:An error occurred while retrieving token from XML response: AADSTS53003: Access has been blocked by Conditional Access policies. The access policy does not allow token issuance.
Is there a way around this? I don't have many permissions on my organisations sharepoint, and the IT technician responded saying: Quote:There must be another authentication method made available by Microsoft (“Modern authentication”). The method you use falls under “Legacy authentication” that is set to be deprecated by the end of the year.
He also recommended I use make, but I prefer coding things myself, and I'm trying to use this code for a college project. I've not coded a lot with python at all, so I want to continue to use it to learn.