gpt4 book ai didi

wcf - 在 WCF 中传递 DefaultCredentials 的等价物是什么?

转载 作者:行者123 更新时间:2023-12-04 20:23:01 32 4
gpt4 key购买 nike

This answer说明在调用 .asmx Web 服务时无需指定要使用的身份验证类型:

WebServiceProxy proxy = new WebServiceProxy(); // Derived from SoapHttpClientProtocol

proxy.Credentials = CredentialCache.DefaultCredentials;

此方法适用于 NTLM 和 Kerberos 身份验证。它将传递运行代码的 Windows 帐户的凭据。

在 NTLM 和 Kerberos 环境中都适用的 WCF 中的等价物是什么?

最佳答案

在 WCF 中,您需要在 WCF 服务的绑定(bind)中指定身份验证。确保客户端和服务器使用相同的身份验证方案。

网络配置:

<binding name="WindowsClientOverTcp">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>

关于wcf - 在 WCF 中传递 DefaultCredentials 的等价物是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4221889/

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