title: WCF Using UserName Authentication with Message Security
body: <p>I am developing an ASP.NET application which will be calling (extensively) WCF services. Now, I am obviously having some kind of mental melt down as I can't for the life of me get this wrapped around my head correctly.</p>
  
  <p>I am using ws2007HttpBinding with Message security and ClientCredentialType of UserName. The WCF is using the ASP.NET Membership provider to validate the user's credentials.</p>
  
  <p>This all works fine but I obviously need to include the user details in ever call:</p>
  
  <pre><code>var service = new MyService.MyServiceClient();
  service.ClientCredentials.UserName.UserName = "my_username";
  service.ClientCredentials.UserNane.Password = "mypassword";
  
  .... etc ...
  
  service.Close();
  </code></pre>
  
  <p>Now, this is easy from the login page as the user has just given us their username and password. I am not comfortable with storing the password for use later on down the road when we need to call another service with the users credentials.</p>
  
  <p>Am I missing something obvious? I have read about tokens etc but I not entirely sure how to go about implementing that kind of thing. I have spent all day searching and reading and I am still unsure, so any help you can give will be greatly appreciated!</p>