gpt4 book ai didi

java - 从 Java 到 Online Federated Dynamics CRM 2013 的 Web 服务身份验证

转载 作者:行者123 更新时间:2023-12-01 13:18:41 24 4
gpt4 key购买 nike

我正在开发一个 Java 程序,通过 Web 服务与 Microsoft Dynamics CRM 2013 在线版本集成。身份验证与本地 IDP 联合,而不是通过 Windows Live。我在查找有关如何完成此操作的文档时遇到问题。所有非.NET环境documentation我看到没有显示如何在联合设置中完成集成。

是否可以通过 Java 使用此身份验证配置中的 Dynamics CRM Web 服务?如果是这样,我们将不胜感激任何文档/代码示例。

最佳答案

根据我的研究,似乎无法使用联合(本地 ADFS)ID 与 Dynamics Web 服务集成。我们使用的 IDP 不响应 WS-Trust RequestSecurityToken,因此我无法检索 SAML。即使我是,this article表明无法检索 Dynamics SAML:

The issue is that the XML SOAP message that access control service accepts has to be signed and the detail on how to do that is internal to the CRM SDK/Identity Model.

Since you can’t sign the XML message to send to the access control service, integration with CRM 2011 cannot work.

文章接着指出,解决方法是创建 Microsoft Online ID。就我而言,这是 Office 365 中的云用户。将该用户添加到我的 Dynamics 实例后,我就能够使用问题中链接的文档中描述的方法。

为了完整起见,下面是向 https://login.microsoftonline.com/RST2.srf 发出的 SOAP 请求的示例

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:Action>
<a:MessageID>urn:uuid:{GENERATE-GUID-HERE}</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo4TBVw9fIMZFmc7ZFxBXIcYAAAAAbd1LF/fnfUOzaja8sGev0GKsBdINtR5Jt13WPsZ9dPgACQAA</VsDebuggerCausalityData>
<a:To s:mustUnderstand="1">https://login.microsoftonline.com/RST2.srf </a:To>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>{UTC-TIMESTAMP}</u:Created>
<u:Expires>{UTC-TIMESTAMP}</u:Expires>
</u:Timestamp>
<o:UsernameToken u:Id="uuid-14bed392-2320-44ae-859d-fa4ec83df57a-1">
<o:Username>{CLOUD-USERNAME}</o:Username>
<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">{CLOUD-PASSWORD}</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s:Body>
<t:RequestSecurityToken xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<a:EndpointReference>
<a:Address>urn:crmna:dynamics.com</a:Address>
</a:EndpointReference>
</wsp:AppliesTo>
<t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType>
</t:RequestSecurityToken>
</s:Body>
</s:Envelope>

替换以下字段:

  • MessageID:随机 GUID
  • 时间戳/创建:当前时间ISO-8601 Format : YYYY-MM-DDThh:mm:ss.sssZ
  • 时间戳/过期:过期时间为ISO-8601 Format : YYYY-MM-DDThh:mm:ss.sssZ
  • 用户名:您的云用户名
  • 密码:您的云密码

响应将包含一个 KeyIdentifier 和 2 个 CypherValue 元素。使用它们构建 CRM 请求的 SOAP header 。完整的代码可以在问题中引用的链接中找到。

关于java - 从 Java 到 Online Federated Dynamics CRM 2013 的 Web 服务身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22235000/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com