简体   繁体   English

如何使用samel 2令牌通过WEB API 2016 CRM服务进行身份验证

[英]How to use samel 2 token to authenticate with WEB API 2016 CRM service

I have successfully got a security token (samel2.0) by comply to the ws-trust specification. 我已经通过遵守ws-trust规范成功获得了安全令牌(samel2.0)。 What I cannot continue how can I use this token to access my service (CRM 2016 web api)? 我无法继续如何使用此令牌访问我的服务(CRM 2016 web api)?

Here's the token I have got: 这是我得到的令牌:

<encryptedassertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
<xenc:encrypteddata xmlns:xenc="http://www.w3.org/2001/04/xmle..." type="http://www.w3.org/2001/04/xmle...">
<xenc:encryptionmethod algorithm="http://www.w3.org/2001/04/xmle..."/>
<keyinfo xmlns="http://www.w3.org/2000/09/xmld...">
<e:encryptedkey xmlns:e="http://www.w3.org/2001/04/xmle...">
<e:encryptionmethod algorithm="http://www.w3.org/2001/04/xmle...">
<digestmethod algorithm="http://www.w3.org/2000/09/xmld..."/>
</e:encryptionmethod>
<keyinfo>
<ds:x509data xmlns:ds="http://www.w3.org/2000/09/xmld...">
<ds:x509issuerserial>
<ds:x509issuername>CN=*.crm.maxtrain.com</ds:x509issuername>
<ds:x509serialnumber>...</ds:x509serialnumber>
</ds:x509issuerserial>
</ds:x509data>
</keyinfo>
<e:cipherdata>
<e:ciphervalue>...</e:ciphervalue>
</e:cipherdata>
</e:encryptedkey>
</keyinfo>
<xenc:cipherdata>
<xenc:ciphervalue>...</xenc:ciphervalue>
</xenc:cipherdata>
</xenc:encrypteddata>
</encryptedassertion>

Any help will be appreciated. 任何帮助将不胜感激。

For me simply I have added the token as a Bearer token with the HTTP header message like this format Authorization: Bearer <xml token> . 对我来说,我只是将令牌添加为带有HTTP头消息的Bearer令牌,如格式Authorization: Bearer <xml token> So per http request you have to include that header. 因此,根据http请求,您必须包含该标头。

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

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