私はフォームベースの認証でセキュリティを処理する簡単なWebサービスを用意しています。Webアプリケーション経由のWCFフォームベース認証 - 資格渡し
WCFTestService.ServiceClient myService = new
WCFTestService.ServiceClient();
myService.ClientCredentials.UserName.UserName = "user";
myService.ClientCredentials.UserName.Password = "secret";
lblResult.Text = myService.GetData(1231);
myService.Close();
私はウェブアプリケーション経由でアクセスしています。だから私は上記を一度やりたいが、セキュリティ/パフォーマンスのためにもう一度やる必要はない。私はをFormsAuthenticationこの文句を言わない作業を使用しているように私はあなたが何をしようとして
//Obtain the authenticated user's Identity and impersonate the original caller
using (((WindowsIdentity)HttpContext.Current.User.Identity).Impersonate())
{
WCFTestService.ServiceClient myService2 = new WCFTestService.ServiceClient();
lblResult.Text = "From Logged On Credentials"+myService2.GetData(1231);
myService2.Close();
}