Я пытаюсь получить доступ к сайту SharePoint от Python, и кажется, что AADSTS имеет политику условного доступа, которая мешает мне получить токен."C:\Python\envs\dev\python.exe c:\Users\xxxxxx.vscode\extensions\ms-python.python-2020.8.105369\pythonFiles\lib\python\debugpy\launcher 52801 -- c:\xxxx\Code\PythonSharepointUpdate\readsharepoint.py " 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. An error occurred while retrieving auth cookies from https://microsoft.sharepoint.com/_vti_bin/idcrl.svc/
< /code>
Я пытаюсь выполнить этот код из примера < /p>
from office365.runtime.auth.user_credential import UserCredential
from office365.sharepoint.client_context import ClientContext
from office365.runtime.auth.authentication_context import AuthenticationContext
site_url = 'https://microsoft.sharepoint.com/teams/'
ctx = ClientContext(site_url).with_credentials(UserCredential("user@domain.com", "My Complex Password”))
web = ctx.web
ctx.load(web)
ctx.execute_query()
print("Web title: {0}".format(web.properties['Title']))
< /code>
Также - есть ли лучший способ аутентификации в SharePoint - я ненавижу вводить свой пароль в четком тексту в коде ☹ < /p>
Кто -нибудь использует ClientCredential? Есть ли отдельная настройка на сайте SharePoint, чтобы включить ClientCredential? Наш SharePoint позволил нам это сделать?
Подробнее здесь: https://stackoverflow.com/questions/636 ... sharepoint
Доступ к Office365 SharePoint Rest Endpoints с использованием Python (Office365 SharePoint Rest для Python) ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Office365-Rest-Python-Client-Как прочитать более 100 рядов из SharePoint (MS-List)
Anonymous » » в форуме Python - 0 Ответы
- 3 Просмотры
-
Последнее сообщение Anonymous
-