none
How to pass domain user credentials to wcf service RRS feed

  • General discussion

  • when i will develop wcf client then how to write the code to pass windows credential to wcf service.

    i got a code which show how to pass user name & password

    private static void Main(string[] args)
    {
         var client = new WcfServiceClient();
         client.ClientCredentials.UserName.UserName = username;
         client.ClientCredentials.UserName.Password = password;
         if(client.IsValid())
         {
              Console.Write(client.GetData(1));
         }
         client.Close();
         Console.Read();
    }
    but i do not understand how to pass logged in user's credentials to service from consumed client. what will be the cod. thanks

    Tuesday, April 1, 2014 8:33 AM

All replies

  • good link

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/0aac0110-187e-4a00-a597-f15b768cf16c/passing-client-credentials-to-wcf-service?forum=wcf

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/075065aa-9fcd-426e-8f12-b84d767a57af/how-to-identify-the-domain-and-ntaccount-of-the-user-who-is-invoking-a-wcf-service?forum=wcf

    Tuesday, April 1, 2014 8:40 AM
  • Good !!
    you can mark it as answer.
    Wednesday, April 2, 2014 7:47 AM