2009-07-03 12 views
1

WCFと承認についての助けが必要です。 現在、私はWindowsサービスでホストされ、WCFサービス(wshttpbindingを使用して)を呼び出している.NET Remotingオブジェクトとして呼び出すクライアントを持っています。 WCFサービスは、メッセージベースのセキュリティでWindows認証を使用しています。wcfコールのクライアント側を偽装する方法

Windowsサービスは特別なアカウントで実行されています。 クライアント呼び出しが.NETリモートオブジェクトに到着すると、thread.currentprincipalがクライアントから提供されたプリンシパルに設定され、すべてのアクションがクライアントの資格情報で実行されます。 これまでのところ問題はありません。現在のところ私の現在の問題です: wcfサービスは、クライアントのユーザー資格情報で呼び出される必要があります。 Afaik WCFは、WindowsIdentity.GetCurrentを使用して呼び出しの認証情報を作成します。 Thread.CurrentPrincipalは呼び出しに使用するIDを保持しているため、(WindowsIdentityのhread.CurrentPrincipal.Identity).Impersonate()はそのジョブを実行します。

しかし、今私は、この例外の代わりにWCFセキュリティ例外を取得しています: System.ComponentModel.Win32Exception:いいえ資格情報は、セキュリティパッケージで提供されていない

コールスタック:System.IdentityModel.SspiWrapper.AcquireCredentialsHandleで ( System.ServiceModel.Security.SecurityUtils.GetCredentialsHandle(ストリングパッケージ、NetworkCredentialの信任状、ブールisServer、文字列に文字列パッケージ、CredentialUse意図、AuthIdentityEx & authdata) [] System.ServiceModel.Security.SecurityUtils.GetCredentialsHandle(SecurityBindingElement SBEでadditionalPackages) 、ClientCredentials clientCredentials)System.ServiceModelでSystem.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpeningでSystem.ServiceModel.Security.SecuritySessionSecurityTokenProvider.OnOpeningでSystem.ServiceModel.Security.SecurityUtils.GetCredentialsHandle(SecurityBindingElement SBE、BindingContextをコンテキスト)で () () 。 System.ServiceModel.SecurityでSystem.ServiceModel.Security.SecurityUtils.OpenTokenProviderIfRequired(SecurityTokenProvider tokenProvider、のTimeSpanタイムアウト)でChannels.CommunicationObject.Open System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Openで(のTimeSpanタイムアウト) (のTimeSpanタイムアウト) 。 SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpanタイムアウト) at System.ServiceModel.Channels.CommunicationObject。 System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModelが開放System.ServiceModel.Channels.CommunicationObject.Open(のTimeSpanタイムアウト)でSystem.ServiceModel.Channels.ServiceChannel.OnOpenで(のTimeSpanタイムアウト) (のTimeSpanタイムアウト) .Channels.ServiceChannel.ICallOnce.Call(ServiceChannelチャネル、TimeSpanタイムアウト) at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpanタイムアウト、CallOnceManagerカスケード) at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpanタイムアウト) at System.ServiceModel.Channels.ServiceChannel.Call(String action、Boolean oneway、ProxyOperationRuntime操作、Object [] ins、Object [] outs、TimeSpanタイムアウト) at System.ServiceModel.Channels.ServiceChannel.Call(String action、Boolean oneway、ProxyO (System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall、ProxyOperationRuntime operation)) のSystem.ServiceModel.Channels.ServiceChannelProxyの で、呼び出します(IMessageがメッセージ)任意の助け

THX マーティン

編集:私は偽装した後のChannelFactoryを作成するのを忘れたので、私は、この例外につながるミスを犯したが、今は別の例外を取得 System.IO.FileLoadException:ファイルまたはアセンブリ 'System.IdentityModel.Selectors、Version = 3.0.0.0、Culture = neutral、PublicKeyToken = b77a5c561934e089'またはその依存関係の1つを読み込めませんでした。必要な偽装レベルが指定されていないか、提供されている偽装レベルが無効です。 (HRESULTからの例外:0x80070542)

答えて

関連する問題