使用连接字符串发出与 CRM 的连接

问题描述

我们有一个 crm 在线实例,并且有一些任务调度程序作业,它们使用工具连接字符串使用 crm 进行连接。

我们正在将应用程序用户从在线用户 (username@orgname.onmicrosoft.com) 更改为 AD 用户 (username@domain.com),但是当我们在连接字符串中尝试新用户时收到错误消息。

我尝试更改连接字符串的 AuthType 属性,但一直出现错误

当前连接字符串为:

Url=https://orgname.crm4.dynamics.com;
Username= username@orgname.onmicrosoft.com;
Password=pass;
ClientId=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX;
AuthType=OAuth;
RedirectUri=http://localhost:55162/; 

将连接字符串改为:

Url=https://orgname.crm4.dynamics.com;
Username= username@domain.com;
Password=pass;
ClientId=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX;
AuthType=OAuth;
RedirectUri=http://localhost:55162/;

OrganizationWebProxyClient 属性为空,在我们得到的 LastCrmError 中

ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error
parsing_ws_Metadata_exchange_Failed: Parsing WS Metadata exchange Failed => The ';' character,hexadecimal value 0x3B,cannot be included in a name. Line 14,position 223.Unable to connect to CRM: The ';' character,position 223.
Unable to Login to Dynamics CRMOrganizationWebProxyClient is null

当我将 AuthType 更改为 Office365 时,出现错误

Unable to connect to CRM: CData elements not valid at top level of an XML document. Line 1,position 3.
Metadata contains a reference that cannot be resolved: 'https://adfs.domain.com/adfs/services/trust/mex'. => CData elements not valid at top level of an XML document. Line 1,position 3.Unable to Login to Dynamics CRM
Unable to Login to Dynamics CRMOrganizationWebProxyClient is null

当我将 AuthType 更改为 AD 时,出现错误

Unable to login to Dynamics CRM,Error was : 
Data[0] = "The provided uri did not return any Service Endpoints!
{0}"
Data[1] = ""
Data[0] = "The provided uri did not return any Service Endpoints!
{0}"
Data[1] = ""Unable to Login to Dynamics CRM
Unable to Login to Dynamics CRMOrganizationWebProxyClient is null

新的用户名和密码是正确的,因为我可以使用浏览器登录到 crm 没有任何问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)