'AADSTS53003 error during getting file from sharepoint
I am trying to get file from sharepoint and everything is fine till I get:
ValueError: 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.
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.files.file import File
root_url = "https://company.sharepoint.com"
full_url = "https://company.sharepoint.com/sites/Development/Shared%20Documents/sharepoint/test1.xlsx"
ctx = ClientContext(root_url)
ctx.with_user_credentials(username,password)
response = File.open_binary(ctx, full_url)
print(response.content)
I tried and looked for solutions but it didn't is this about some sharepoint policy settings?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|