使用多重身份验证连接到SharePoint Online网站的C#代码 [英] C# code that connects to SharePoint Online site using Multi-Factor Authentication
问题描述
大家好,
我们有一个使用的Office 365环境
多重身份验证。当用户键入其用户名和密码到SharePoint在线站点时,还会向他们发送带有附加密码的文本消息。
我要做的是编写一个连接到SharePoint在线环境的C#Windows桌面应用程序,使用
多重身份验证。
有人可以发送网站网址或C#代码来演示如何使用
<创建一个简单的Windows桌面应用程序span name ="x_x_x_x_subject">多重身份验证。
我希望你能提供帮助!
Colin
设置多个对用户进行因子身份验证,构建
ClientContext以连接到SharePoint Online网站时,如果我们仍然将用户名+密码传递给SharePointOnlineCredentials对象,则会出现这样的错误消息:
因此,我们需要将用户名+应用程序密码传递给SharePointOnlineCredentials对象。
"应用程序密码,是在Azure门户中创建的密码,允许用户绕过多因素身份验证并继续使用他们的申请"。
有关多因素身份验证中应用密码的更多信息:
有关如何使用SharePointOnlineCredentials对象连接到SharePoint Online网站的演示供您参考:
http://www.vrdmn.com/2013/01/authenticating-net-client-object-model.html
感谢跨度>
Hi All,
We have an Office 365 environment that uses Multi-Factor Authentication. When a user types in their username and password to the SharePoint online site, they are also sent a text message with an additional password.
What I am trying to do is write a C# Windows desktop application that connects to the SharePoint online environment using the
Multi-Factor Authentication.
Can someone please send either a website url or C# code that demonstrates how to create a simple Windows desktop application that uses
Multi-Factor Authentication.
I hope you can help !
Colin
Hi,
After set up multi-factor authentication for an user, when constructing ClientContext to connect to SharePoint Online site, if we still pass the username + password to SharePointOnlineCredentials object, there will be an error message thrown like this:
Thus, we will need to pass the username + App Password to SharePointOnlineCredentials object instead.
"An app password, is a password that is created within the Azure portal that allows the user to by-pass the multi-factor authentication and continue to use their application".
More information about App Password in multi-factor authentication:
A demo about how to connect to SharePoint Online site with the help of SharePointOnlineCredentials object for your reference:
http://www.vrdmn.com/2013/01/authenticating-net-client-object-model.html
Thanks
这篇关于使用多重身份验证连接到SharePoint Online网站的C#代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!