title: How to use WCF client in ASP.NET application?
body: <p>I have these components:</p>
  
  <ol>
  <li>ASP.NET application (website) </li>
  <li>WIF security </li>
  <li>WCF service (secured via 2)</li>
  </ol>
  
  <p>Let's say the WCF service (TestService) has one secured method:</p>
  
  <pre><code>  Boolean IsItWorking();
  </code></pre>
  
  <p>Now the page in a website does these steps:</p>
  
  <ol>
  <li>go to a restricted page</li>
  <li>provide login credentials</li>
  <li>processes WIF request/response => cookies created</li>
  <li>page provides ClientCredentials to a singleton! WCF client reference</li>
  <li>page calls the TestService.IsItWorking() </li>
  </ol>
  
  <p>It worked fine, until I realized that the singleton client instance is not working. How to provide credentials to a client? Where to keep the credentials? How to solve this scenario correctly? </p>