使用Windows身份验证获得DNS身份类型意味着什么?

时间:2012-01-27 00:00:51

标签: .net wcf wcf-security

在高级别上,在为WCF服务使用Windows身份验证时指定DNS身份是什么意思?例如:

<configuration>
<system.serviceModel>
  <bindings>
    <wsHttpBinding>
      <binding name="WSHttpBinding_ICalculator_Windows">
        <security>
          <message clientCredentialType="Windows"/>
        </security>
      </binding>
    </wsHttpBinding>
  </bindings>
  <client>
    <endpoint address="http://localhost:8003/servicemodelsamples/service/dnsidentity"
      binding="wsHttpBinding"
      bindingConfiguration="WSHttpBinding_ICalculator_Windows"
      contract="ICalculator"
      name="WSHttpBinding_ICalculator">
      <identity>
        <dns value="contoso.com" />
      </identity>
    </endpoint>
  </client>
</system.serviceModel>
</configuration>

This page说:

  

在这种情况下,当客户端收到服务的Windows(Kerberos)凭据时,它希望该值为contoso.com。

我真的不明白这一点。服务凭证的价值如何才能成为contoso.com?凭证是什么意思?

它是否还验证服务的实际DNS名称确实是contoso.com?否则,什么会阻止某人写一个说其身份的流氓WCF服务是contoso.com?

2 个答案:

答案 0 :(得分:1)

如果我没有弄错,contoso.com用于解析Kerberos的SPN。查询的SPN将是http / contoso.com:8003。此SPN将在Active Directory中映射到服务帐户。 Kerberos票证将使用服务帐户的凭据进行加密。

答案 1 :(得分:0)

我意识到这是一个老问题,但我发现在使用Windows传输的tcp绑定的自托管服务中,客户端似乎不尊重SpnIdentity设置,只考虑DnsIdentity设置。点击此处:wcf server authentication without certificates了解更多信息和/或评论。