代码之家  ›  专栏  ›  技术社区  ›  Alex Angas Colin

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

  •  5
  • Alex Angas Colin  · 技术社区  · 15 年前

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


    WebServiceProxy proxy = new WebServiceProxy(); // Derived from SoapHttpClientProtocol
    
    proxy.Credentials = CredentialCache.DefaultCredentials;
    

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


    在WCF中,在NTLM和Kerberos环境中工作的等价物是什么?

    1 回复  |  直到 9 年前
        1
  •  4
  •   ericphan    15 年前

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

    web.config:

    <binding name="WindowsClientOverTcp">
        <security mode="Transport">
            <transport clientCredentialType="Windows" />
        </security>
    </binding>
    
    推荐文章