我正在研究Java程序,通过Web服务与Microsoft Dynamics CRM 2013在线版本集成。身份验证与本地IDP联合使用,而不是通过Windows Live联合使用。我在寻找有关如何完成此操作的文档时遇到问题。我所看到的所有非-.net环境文档都没有显示如何完成联合设置中的集成。
是否可以在Java的此身份验证配置中消耗Dynamics CRM Web服务?如果是这样,请感谢任何文档/代码样本。
根据我的研究,似乎无法使用联合(本地ADFS)ID与Dynamics Web服务集成。我们正在使用的IDP不会响应WS-Trust RequestSecurityToken,因此我无法检索SAML。不过,即使我是,本文也建议无法检索Dynamics SAML:
问题是必须签署访问控制服务接受的XML SOAP消息,以及有关此操作的详细信息是CRM SDK/IDENSITY模型的内部。
由于您无法签署XML消息发送到访问控制服务的XML消息,因此与CRM 2011集成无法正常工作。
文章继续指出,解决方法是创建Microsoft在线ID。就我而言,这是Office 365中的云用户。将此用户添加到我的Dynamics实例中,我就可以使用问题中链接的文档中描述的方法。
为了完整的清晰,下面是https://login.microsoftonline.com/rst2.srf
提出的肥皂请求的示例<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
- TIMESTAMP/创建:ISO-8601格式中的当前时间:yyyy-mm-ddthh:mm:ss.ssss
- TIMESTAMP/EVIRES :在ISO-8601格式中到期时间:yyyy-mm-ddthh:mm:ss.ssssz
- 用户名:您的云用户名
- 密码:您的云密码
该响应将包含一个关键识别器和2个Cyphervalue元素。使用这些来构建肥皂标头,以供向CRM的请求。完整代码可以在问题中引用的链接中找到。