【发布时间】:2009-10-28 13:36:02
【问题描述】:
我正在寻找一些技术细节,了解在使用如下 WCF 绑定进行消息交换期间实际用户名 + 密码(凭据)的存储位置。
<bindings>
<wsHttpBinding>
<binding name="wsHttp">
<security mode="TransportWithMessageCredential">
<transport/>
<message clientCredentialType="UserName"
negotiateServiceCredential="false"
establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
然后在客户端应用程序中,我调用此服务传递一组有效的凭据,像这样
using (SupplierServiceClient client = new SupplierServiceClient()) {
client.ClientCredentials.UserName.UserName = "admin";
client.ClientCredentials.UserName.Password = "password";
SupplierList = client.GetSupplierCollection();
}
起初我认为 WCF 正在获取这些数据并将其放入 SOAP 标头中,但从 WSDL 中并没有这样显示...有什么帮助吗?
编辑:
以下是客户端的安全配置在生产中的样子
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message clientCredentialType="UserName" establishSecurityContext="false" />
</security>
【问题讨论】:
标签: c# .net wcf wcf-binding credentials