将我的网站移到不同的服务器将Kerberos身份validation更改为NTLM

我有一个为Windows身份validationconfiguration的web服务。 调用WS的客户端代码将凭据传递给WS,如下所示:

myWebService.Credentials = System.Net.CredentialCache.DefaultCredentials; 

(我的理解是,这代表login用户的用户名 – 密码域)。

我正在testingconfiguration问题,并对如何确保Kerberos设置感到困惑。

详细信息关注:

我在同一个IIS服务器上有两个虚拟目录(一个是带“.aspx”页面的“客户端”),另一个是“服务器”(它托pipe着客户端调用的web服务)。

我的客户端通过此代码显示关于连接用户的关键信息:

 private string GetUserInfo() { System.Security.Principal.WindowsIdentity UserIdentityInfo; StringBuilder msg = new StringBuilder("User Name: "); UserIdentityInfo = System.Security.Principal.WindowsIdentity.GetCurrent(); msg.Append(UserIdentityInfo.Name); msg.Append(Environment.NewLine); msg.Append(" Token: "); msg.Append(UserIdentityInfo.Token.ToString()); msg.Append(Environment.NewLine); msg.Append(" Authenticated: "); msg.Append(UserIdentityInfo.AuthenticationType); msg.Append(Environment.NewLine); msg.Append(" System: "); msg.Append(UserIdentityInfo.IsSystem); msg.Append(Environment.NewLine); msg.Append(" Guest: "); msg.Append(UserIdentityInfo.IsGuest); msg.Append(Environment.NewLine); msg.Append(" Anonymous: "); msg.Append(UserIdentityInfo.IsAnonymous); msg.Append(Environment.NewLine); return msg.ToString(); } 

当Web客户端和被调用的Web服务位于同一台服务器(例如SERVER1)上时,authenticationtypes是Kerberos 。 实际执行也正确。

当调用相同的webclient代码时,身份validationtypes将更改为NTLM ,但现在驻留在SERVER2上。 被调用的webservice仍驻留在原始服务器(SERVER1)上。 实际执行失败,因为凭据不正确。

SERVER1和SERVER2在同一个局域网(同一个域),我用于testing上述每个场景的域帐户是相同的(我在每台机器上的pipe理员组)。

我怎样才能configuration这个,所以KERBEROS是authenticationtypes – 即当SERVER2上的这个客户端被“我”从浏览器调用?

你有什么是一个经典的双跳局面。 下面的文章中的graphics几乎是你的确切情况:

http://blogs.technet.com/b/askds/archive/2008/06/13/understanding-kerberos-double-hop.aspx

当你的'客户'和'服务'都在Server1上时,只有一个“单跳”来validation用户。 当您将Server2引入混合中时,您现在已经拥有了双重身份validation,现在已经委派了身份validation。

由于您将应用程序池作为域帐户运行,因此需要设置服务主体名称(SPN)以防止出现双跳。 有上面的post中提到的资源。 这篇文章中也提到了它:

http://msdn.microsoft.com/en-us/library/ff649309.aspx

需要为特定用户帐户,服务和主机名创buildSPN。 这需要在域控制器上完成。