使用 CrmServiceClient 连接到 CRM2013 组织,"Unable to login to Dynamics CRM" 使用 AuthType=IFD

Using CrmServiceClient to connect to CRM2013 org, "Unable to login to Dynamics CRM" using AuthType=IFD

我正在尝试使用 CrmServiceClient 通过连接字符串连接到 CRM2013 组织 "AuthType=IFD;Url=https://server.company.com/OrgName;Domain=DomainName;Username=DomainName\UserName;Password=UserPassword" 这适用于某些服务器而不适用于其他服务器

返回的错误是:"Unable to login to Dynamics CRM" 有什么地方可以让我了解有关该错误的更多详细信息?某处的日志文件?

用户名和密码正确 在 XRMToolbox 中使用此连接字符串有效

任何有关在哪里查看的想法将不胜感激

我也试过这个连接字符串 "AuthType=IFD;Url=https://orgname.company.com/OrgName;Domain=DomainName;Username=DomainName\UserName;Password=UserPassword"

        try
        {
            if (ServicePointManager.SecurityProtocol != SecurityProtocolType.Tls12)
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

            using (var service = new CrmServiceClient(crmConnectionString))
            {
                if (!service.IsReady)
                {
                    if (service.LastCrmException != null)
                        throw service.LastCrmException;

                    throw new InvalidOperationException(service.LastCrmError);
                }

                    :
                    :
                    :
            }
        }
        catch (Exception ex)
        {
            String error = "";
            if (ex.InnerException != null)
            {
                error = ex.InnerException.Message;
            }
            else
            {
                error = ex.Message;
            }
            throw new Exception("RetrieveConfiguration, failed to authenticate user: " + error);
        }

事实证明,ADFS 服务器没有启用 TLS 1.2。 一旦启用并且服务器重新启动,它就开始正常工作了

感谢扎克试图帮助解决这个问题