簡體   English   中英

IIS 7.5中的Windows身份驗證因信任關系異常而失敗

[英]Windows Authentication in IIS 7.5 Fails with Trust Relationship Exception

我有一個ASP.Net 2.0應用程序,它使用集成的Windows身份驗證來驗證/授權用戶。 該應用程序在Windows XP / IIS 5.1,Windows Server 2008 / IIS 7和Windows Vista / IIS 7上運行正常。當我嘗試在Windows 7 / IIS 7.5上運行此應用程序時,我得到以下異常: The trust relationship between this workstation and the primary domain failed.

堆棧跟蹤如下:

[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>

我在研究此錯誤時發現的大多數結果表明問題與域中的計算機帳戶損壞有關,並將解決方案列為重新加入域。 我已經這樣做但錯誤仍然出現。 “正常”域操作正常(訪問UNC共享,登錄等)。

出於兼容性原因,此應用程序在Classic .Net AppPool中運行。 我嘗試將AppPool的身份更改為“NetworkService”,但錯誤仍然存​​在。

任何幫助是極大的贊賞。

在Windows Server 2008 R2上遇到同樣的問題后,我終於找到了答案。 這篇文章

在Windows 2008 R2服務器上禁用以下策略,運行gpupdate / force並重新啟動服務器。

“計算機配置\\ Windows設置\\安全設置\\本地策略\\安全選項”

域成員:對安全通道數據進行數字加密或簽名(始終)
域成員:對安全通道數據進行數字加密(如果可能)
域成員:對安全通道數據進行數字簽名(如果可能)

我可以確認這也解決了Windows 7上的問題。

我正在添加這個以供將來參考:

“在運行Windows 7或Windows Server 2008 R2的計算機上使用LookupAccountName函數時出現錯誤1789”

http://support.microsoft.com/kb/976494

這也可能是解決問題的方法。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM