2012-06-24 35 views
2

背景:雙跳與ASP.Net網站和NHibernate

ASP.Net MVC的網站。內部網IIS7上託管。

數據庫:SQL Server。通過NHibernate訪問。
在連接字符串中,訪問設置爲Integrated Security: SSPI
(權限DB是基於活動目錄 - )。

總之,這是一個典型的雙躍點的情況下,
,我需要通過客戶端的憑據IIS,並從IIS到SQL Server。

問題:

的問題是死亡的黃色畫面,出現錯誤:
Login failed for user 'MyDomain\UserThatRunsAppPool'.

事情我試圖做來解決這個問題:

  • 將身份驗證配置爲僅啓用Windows身份驗證
    ASP.NET模擬
  • 設置Windows身份驗證ProviderNegotiate:Kerberos
  • 確保UserThatRunsAppPool代表團設置爲(禁用內核模式身份驗證後):
    'Trust the user for delegation to any service (Kerberos only)' 在Active Directory中
  • 將創建的NHibernate SessionFactory從Application_BeginRequest()
    移至Session_Start()

我已經成功如何用我的努力來解決這個問題:

不是。


編輯:
我也嘗試過IIS服務器的授權設置爲 'Trust the user for delegation to any service (Kerberos only)'(在Active Directory)。

回答

3
In short, this is a typical double-hop situation, 
where I need to pass client's credentials to IIS, and from IIS to SQL Server. 

你遇到了「授權」問題。如果您想保持理智,請將連接字符串更改爲使用SQL用戶名+密碼而不是SSPI。

如果您覺得像兩週的調試失敗並與您的域管理員爭吵,請閱讀Fun with the Kerberos Delegation Web Site

+1

如果他的「MyDomain \ UserThatRunsAppPool」登錄失敗,這意味着該調用不會模擬HTTP調用者。與代表團的樂趣只會在*之後起作用,即一旦他成功修復了假冒。 –