简体   繁体   English

使用Office 365 / ADFS SingleSignOn时,使用用户名和密码从C#连接到CRM Online

[英]Connecting to CRM Online from C# using username and password when using Office 365/ADFS SingleSignOn

We have CRM Online/Office 365 environment synced with an On-premise AD to enable single sign on from the desktop. 我们已将CRM Online / Office 365环境与本地AD同步,以启用从桌面的单点登录。 However, since enabling this we are unable to connect to CRM Online from C# using a username and password - using the domain username and password results in "clientCredentials.UserName.UserName or clientCredentials.Windows.ClientCredential.UserName MUST be populated!" 但是,由于启用了此功能,因此我们无法使用用户名和密码从C#连接到CRM Online-使用域用户名和密码将导致“必须填充clientCredentials.UserName.UserName或clientCredentials.Windows.ClientCredential.UserName!”

Any thoughts ? 有什么想法吗 ?

Documenting my findings for anyone else that experiences this problem. 为遇到此问题的其他任何人记录我的发现。

I had the same error, and it was caused by the connection string to the CRM online instance having a user name, a password and domain. 我遇到了同样的错误,这是由具有用户名,密码和域的CRM在线实例的连接字符串引起的。

When I removed the domain from my connection string, and added to the user name, the problem went away. 当我从连接字符串中删除域并将其添加到用户名时,问题就消失了。

This question has some good answers on the correct connection strings to use: Connection to CRM 该问题对要使用的正确连接字符串有一些很好的答案: 与CRM的连接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM