2012-01-27 74 views
1

这是什么意思,在高级别上指定一个WCF服务使用Windows身份验证时的DNS身份?例如:使用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?否则,什么会阻止某人编写一个称为contoso.com的流氓WCF服务?

回答

1

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

+1

如果您将应用程序池作为“网络服务”运行并在标准HTTP端口上运行服务,则SPN值将自动设置为Kerberos身份验证的正确值。如果您使用自定义服务帐户和/或自定义端口,则需要由域管理员设置新的SPN。加入域的计算机的默认SPN设置是host/server和host/server-fqn。 “主机”服务具有HTTP和别名的别名。 – 2012-01-27 00:44:41

0

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