2008-11-04 32 views
0

這可能是一個謊言傳遞Windows令牌到WCF然後從WCF到另一臺服務器,但沒有任何人有一個想法如何:在AD域

傳遞Windows令牌(來自域認證)用戶的WCF所調用的服務 - 服務將根據發出呼叫的用戶Windows憑據執行操作。

即:客戶端 - > WCF - >一些第三方存儲庫與Active Directory集成。

我有一個WCF數據層,負責返回所有的數據 - 目前的客戶,使該服務電話。該服務從存儲庫中檢索文檔。客戶希望通過AD管理所有賬戶來實現這一點,因爲存儲庫支持AD集成。

任何幫助,將不勝感激 - 謝謝你:-)

----------更新 我按照jezell的文章,但我仍然有問題。

我想使用upn而不是spn(這樣帳戶可以被鎖定並且更安全),但是我不知道我得到了什麼錯誤。

我創建的AD服務器上的SPN的(想盡組合,無重複)

下面是一些代碼片段,也許有人有什麼即時通訊做錯了的想法。

Dim binding As New NetTcpBinding() 
binding.Security.Mode = SecurityMode.Message 
binding.Security.Message.AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic128 
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows 

Dim upn As String = "[email protected]" 

Dim ep As New EndpointAddress(New Uri("net.tcp://server1.testdomain.com:1111/ServiceTest") _ 
    , EndpointIdentity.CreateUpnIdentity(upn)) 

Dim factory As New ChannelFactory(Of Credential.Interface.ICredentialTest)(binding, ep) 
factory.Credentials.Windows.AllowNtlm = False 
factory.Credentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Delegation 

Dim iproxy As Credential.Interface.ICredentialTest = factory.CreateChannel() 
Dim co As ICommunicationObject = CType(iproxy, ICommunicationObject) 
iproxy.ToService(result) 

現在我得到的錯誤:「身份校驗失敗傳出消息。預期的身份是... 所有我能找到關於這與使用證書,即時消息不做。

謝謝:-)

回答