使用 Python/身份验证连接到 SharePoint

时间:2021-06-05 21:02:00

标签: python security authentication sharepoint office365

我使用以下代码尝试连接到我公司的 Sharepoint 站点。它提示我输入用户名和密码

import sharepy
from sharepy import connect
from sharepy import SharePointSession


s = sharepy.connect("https://company.sharepoint.com")

我在输入凭据时收到以下错误。当然,我使用这些凭据登录到 sharepoint 站点和 Outlook,因此我知道它存在。如何“将此帐户添加到目录”?或者我可以通过其他任何方式进行连接,也许是通过某种身份验证?我尝试了其他方法,例如导入 office365 库,我总是从中得到:ModuleNotFoundError: No module named 'office365'。任何建议都会很棒。感谢您的帮助!

Requesting security token...
Authentication Failure: AADSTS50034: The user account {EmailHidden} does not exist in the 
company.com directory. To sign into this application, the account must be added to the 
directory

0 个答案:

没有答案