简体   繁体   English

为什么BasicHttpBinding不需要主体名称就可以在IIS7上使用Kerberos Auth?

[英]Why doesn't BasicHttpBinding need a Principal Name to use Kerberos Auth on IIS7?

I know a fair amount about how Kerberos Authentication works, but for the life of me I can't explain a strange behavior I am seeing with an IIS-hosted WCF service. 我对Kerberos身份验证的工作原理了解很多,但就我的一生而言,我无法解释我在IIS托管的WCF服务中看到的奇怪行为。

I've set up an extremely simple WCF app that exposes an endpoint using BasicHttpBinding with TransportCredentialOnly. 我已经建立了一个非常简单的WCF应用程序,该应用程序使用BasicHttpBinding和TransportCredentialOnly公开了一个端点。 My understanding is that for Kerberos to work, a User Principal Name or Service Principal Name must be specified by the client. 我的理解是,要使Kerberos工作,客户端必须指定用户主体名称或服务主体名称。 For some reason it doesn't seem consistent across different binding types. 由于某种原因,在不同的绑定类型之间似乎不一致。

When I omit this principal name, on IIS6, NTLM ends up being used. 当我省略此主体名称时,在IIS6上最终会使用NTLM。 On IIS7, it uses Kerberos. 在IIS7上,它使用Kerberos。 When I specify a User Principal Name on IIS6, Kerberos is used but on IIS7 the calls fail (Wireshark shows an KRB_AP_ERR_BADMATCH error during the Kerberos handshake). 当我在IIS6上指定用户主体名称时,使用Kerberos,但在IIS7上调用失败(在Kerberos握手过程中,Wireshark显示KRB_AP_ERR_BADMATCH错误)。

It gets even more fun when I switch the binding to WSHttpBinding with Message security. 当我通过Message Security将绑定切换到WSHttpBinding时,它会变得更加有趣。 In that experiment if I don't specify the User Principal Name on IIS6 the call fails, and on IIS7 NTLM gets used. 在该实验中,如果我未在IIS6上指定用户主体名称,则调用将失败,并在IIS7上使用NTLM。 When I specify the UPN, IIS6 fails and II7 ends up using Kerberos. 当我指定UPN时,IIS6失败,并且II7使用Kerberos结束。 Here's a summary of my findings. 这是我的发现的摘要。 If anyone out there can help me wrap my mind around what's happening, I'd be eternally grateful. 如果有任何人可以帮助我确定发生的事情,我将永远感激不已。

汇总表

Do you know about kernel-mode authentication in IIS 7? 您知道IIS 7中的内核模式身份验证吗? It removes the need to use a custom identity for the application pool, and it also (in most cases) removes the need to assign SPNs to the custom identity or host machine. 它消除了对应用程序池使用自定义标识的需求,并且(在大多数情况下)也消除了将SPN分配给自定义标识或主机的需求。

Here's a blog post that describes when you need to set SPNs when using kernel-mode authentication. 这是一篇博客文章 ,描述了使用内核模式身份验证时何时需要设置SPN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM