使用带有证书和SAML 1.1的SOAP服务 [英] Consume SOAP Service With Certificate and SAML 1.1

查看:198
本文介绍了使用带有证书和SAML 1.1的SOAP服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有需要使用的SOAP服务,该服务需要证书和SAML 1.1



I have a SOAP service that I need to consume that requires a Certificate and SAML 1.1

到目前为止,我已经能够从商店中获得X509Certificate2,并且我执行了一个client.ClientCertificates.Add(X509Certificate2).

So far I am able to get the X509Certificate2 from the store, and I do a client.ClientCertificates.Add(X509Certificate2).

接下来,我需要知道如何添加SAML令牌.我正在尝试做一个client.RequestSoapContext.Security.Tokens.Add(),但不知道如何添加SAML令牌.

Next I need to know how to add a SAML token.  I am attempting to do a client.RequestSoapContext.Security.Tokens.Add() but do Not know how to add in the SAML token.

在此方面的任何帮助将不胜感激.

Any help on this would be greatly appreciated.

谢谢.

推荐答案

嗨AnilCa,
  在这种情况下,您可以尝试如下操作:
hi AnilCa,
   As per this case, you can try like below :
X509Certificate2 cert = new  X509Certificate2(<initialization parameters>); //The cert details here

X509SecurityToken signatureToken = new X509SecurityToken(cert);

SoapContext requestContext = service.RequestSoapContext;

requestContext.Security.Tokens.Add(signatureToken);

MessageSignature signature = new MessageSignature(signatureToken); 

requestContext.Security.Elements.Add(signature);

有关更多信息,请

for more information, Click here to refer about How to: Add Security Credentials to a SOAP Message.


这篇关于使用带有证书和SAML 1.1的SOAP服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆