Ich habe einen einfachen Webdienst, bei dem die Sicherheit über formularbasierte Authentifizierung gehandhabt wird.WCF formularbasierte Authentifizierung über Web App - Anmeldeinformationen übergeben
WCFTestService.ServiceClient myService = new
WCFTestService.ServiceClient();
myService.ClientCredentials.UserName.UserName = "user";
myService.ClientCredentials.UserName.Password = "secret";
lblResult.Text = myService.GetData(1231);
myService.Close();
Ich greife auf diese über eine Web-App. Also ich möchte das obige einmal machen aber aus Sicherheitsgründen muss ich es nicht nochmal machen. Ich war das unter so etwas wie das zu denken, aber wie ich FormsAuthentication dies nicht funktionieren bin mit ...
//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();
}