Tôi có ứng dụng ASP.Net 2.0 sử dụng Xác thực Windows được tích hợp để xác thực/ủy quyền người dùng. Ứng dụng hoạt động tốt trên Windows XP/IIS 5.1, Windows Server 2008/IIS 7 và Windows Vista/IIS 7. Khi tôi cố chạy ứng dụng này trên Windows 7/IIS 7.5, tôi nhận được ngoại lệ sau: The trust relationship between this workstation and the primary domain failed.
Xác thực Windows trong IIS 7.5 Không có ngoại lệ mối quan hệ tin cậy
stack trace như sau:
[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
các tập tin web.config có chứa các thông tin sau liên quan đến chứng thực/ủy quyền:
<authentication mode="Windows" />
<authorization>
<!--Deny anonymous users-->
<deny users="?"/>
<allow roles="domain\GroupWithAccess"/>
<deny users="*"/>
</authorization>
Hầu hết các kết quả tôi tìm thấy khi nghiên cứu tình trạng lỗi này rằng vấn đề có liên quan đến một tài khoản máy tính trong miền và liệt kê giải pháp khi gia nhập lại miền. Tôi đã làm điều này nhưng lỗi vẫn xuất hiện. Các hoạt động tên miền "bình thường" hoạt động tốt (truy cập vào chia sẻ UNC, đăng nhập, v.v.).
Ứng dụng này chạy trong Ứng dụng cổ điển .Net cho các lý do tương thích. Tôi đã thử thay đổi danh tính của AppPool thành "NetworkService" nhưng lỗi vẫn tồn tại.
Bất kỳ trợ giúp nào được đánh giá cao.
Tôi không có quyền kiểm soát AD phải có thay đổi cấu hình tôi có thể thực hiện để làm việc này –
Điểm bài viết được liên kết tới KB976494 dành cho Server 2008 R2 * RTM *. Đối với SP1, bản sửa lỗi đã được bao gồm. Xem bình luận của tôi về câu trả lời của @ jishi. Tuy nhiên, không chắc liệu cách giải quyết này vẫn có thể áp dụng trong một số trường hợp. – piers7