[英]Access Office365 SharePoint with Single Sign-On via Python
I don't know much of anything about SharePoint, but was tasked to use Python to download a SharePoint list.我对 SharePoint 一无所知,但我的任务是使用 Python 下载 SharePoint 列表。 SharePoint is Office365 and is accessed with Single Sign-on.
SharePoint 是 Office365,可通过单点登录访问。 I found the below sample on how to connect to SharePoint:
我找到了有关如何连接到 SharePoint 的以下示例:
from office365.runtime.auth.user_credential import UserCredential
from office365.sharepoint.client_context import ClientContext
ctx = ClientContext('https://<site>.sharepoint.com').with_credentials(UserCredential('domain\\user', 'password'))
web = ctx.web
ctx.load(web)
ctx.execute_query()
print(web.properties["Url"])
When executing this code I receive the following error:执行此代码时,我收到以下错误:
Cannot get binary security token for from https://login.microsoftonline.com/extSTS.srf
KeyError: 'FedAuth'
Can anyone point me in the right direction?任何人都可以指出我正确的方向吗?
Recently when I was searching for similar kind of solution, I found something useful, you can check below code on github.最近在寻找类似的解决方案时,发现了一些有用的东西,您可以在github上查看以下代码。
https://github.com/vgrem/Office365-REST-Python-Client https://github.com/vgrem/Office365-REST-Python-Client
你找到答案了吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.