Asp.net IIS 7.5中的Windows身份验证失败,出现信任关系异常

Asp.net IIS 7.5中的Windows身份验证失败,出现信任关系异常,asp.net,iis,windows-7,windows-authentication,Asp.net,Iis,Windows 7,Windows Authentication,我有一个ASP.NET2.0应用程序,它使用集成的Windows身份验证对用户进行身份验证/授权。该应用程序在Windows XP/IIS 5.1、Windows Server 2008/IIS 7和Windows Vista/IIS 7上运行良好。当我尝试在Windows 7/IIS 7.5上运行此应用程序时,出现以下异常:此工作站与主域之间的信任关系失败。 堆栈跟踪如下所示: [SystemException: The trust relationship between this work

我有一个ASP.NET2.0应用程序,它使用集成的Windows身份验证对用户进行身份验证/授权。该应用程序在Windows XP/IIS 5.1、Windows Server 2008/IIS 7和Windows Vista/IIS 7上运行良好。当我尝试在Windows 7/IIS 7.5上运行此应用程序时,出现以下异常:
此工作站与主域之间的信任关系失败。

堆栈跟踪如下所示:

[SystemException: The trust relationship between this workstation and the primary domain failed.
]
   System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection sourceAccounts, Boolean& someFailed) +1085
   System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess) +46
   System.Security.Principal.WindowsPrincipal.IsInRole(String role) +128
   System.Web.Configuration.AuthorizationRule.IsTheUserInAnyRole(StringCollection roles, IPrincipal principal) +229
   System.Web.Configuration.AuthorizationRule.IsUserAllowed(IPrincipal user, String verb) +354
   System.Web.Configuration.AuthorizationRuleCollection.IsUserAllowed(IPrincipal user, String verb) +245
   System.Web.Security.UrlAuthorizationModule.OnEnter(Object source, EventArgs eventArgs) +11153304
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171
web.config文件包含以下与身份验证/授权相关的信息:

<authentication mode="Windows" />
<authorization>
  <!--Deny anonymous users-->
  <deny users="?"/>
  <allow roles="domain\GroupWithAccess"/>
  <deny users="*"/>
</authorization>


在Windows Server 2008 R2上遇到同样的问题后,我终于找到了答案。发件人:

在Windows 2008 R2服务器上禁用以下策略,运行gpupdate/force并重新启动服务器

“计算机配置\ Windows设置\安全设置\本地策略\安全选项”

域成员:对安全通道数据进行数字加密或签名(始终)
域成员:对安全通道数据进行数字加密(如果可能)
域成员:对安全通道数据进行数字签名(如果可能)


我可以确认这也解决了Windows 7上的问题。

我添加此项以供将来参考:

“在运行Windows 7或Windows Server 2008 R2的计算机上使用LookupAccountName函数时出现错误1789”


这可能也是问题的一个解决方案。

我无法控制AD,必须对配置进行更改才能将此链接到workLinked文章指向KB976494,这是针对Server 2008 R2 RTM的。对于SP1,修复程序已经包括在内。见我对@jishi答案的评论。但是,不确定此解决方法在某些情况下是否仍然适用。请注意,KB976494包含在Windows Server 2008 R2的SP1中(因此无法再安装)。如果您正在运行SP1,那么这不是您正在寻找的修复程序。请参阅(并下载SP的Excel清单)