在我公司的Intranet环境中,我有几台服务器(都在同一台DC上)。 为了简单起见,我将把我的问题集中在IIS和SQL服务器上。 我在域上的另一台机器上有一个IIS 7.5 Web服务器和一个远程SQL Server 2005。
以下是我希望达到的要求:
select suser_sname()应该通过IIS Web应用程序将执行操作的人员的实际用户名返回给数据库。 我花了至less几个星期(累计)研究这个过去几年,因为我有时间,但没有效果。 请首先帮助我理解,如果能够满足这些要求(因为我有理由相信这一点),请指出我在“如何”做到这一点的正确方向,以及我应该如何解决这个问题。
我到目前为止所做的:
AuthenticationType报告Kerberos AuthenticationTypevalidationtypes。 我已经能够完成的最好的事情是确认Kerberos http标题的存在,但是我的testing应用程序显示应用程序池的自定义用户(SPN帐户)正在通过,而不是我自己的。 这里是我的testing应用程序的结果,如果你喜欢:
Result Field Description Test App Code ------ ----------------- ------------- Negotiate Page Authentication Type Page.User.Identity.AuthenticationType <dc>\<username> Page Identity Page.User.Identity.Name Kerberos Principal Windows Auth Type WindowsIdentity.GetCurrent().AuthenticationType <dc>\<spnUser> Principal Windows Identity WindowsIdentity.GetCurrent().Name <dc>\<username> HttpContext User HttpContext.Current.User.Identity.Name <dc>\<username> Server Var "LOGON_USER" Request.ServerVariables("LOGON_USER") <dc>\<username> Thread Current Principal Threading.Thread.CurrentPrincipal.Identity.Name