title: How do I force a refresh of the security token for a WCF service?
body: <p>I have a WCF Service that requires a security token issued by a separate WCF STS Service. This all works just dandy.  In my application, I use the service like so:</p>
  
  <pre><code>MyServiceClient myService = new MyServiceClient();
  myService.Open();
  myService.DoStuff();
  </code></pre>
  
  <p>The STS Service is called to get a token and the token is used to call the service method DoStuff.</p>
  
  <p>Once the initial handshake is over, though, the <code>myService</code> object has the token cached and re-uses it until it expires. This is fine behavior and all, but how would I <em>force</em> it to refresh the token?</p>
  
  <pre><code>myService.ClientCredentials.Invalidate(); // something like this?
  </code></pre>
  
  <p>Such that if I called DoStuff() again it would know it needs to go to the STS again much as it did the first time.</p>
  
  <p>Am I stuck just making a new proxy class object, i.e. <code>myService = new MyServiceClient();</code>? This works but it seems like the nuclear bomb solution.</p>
  
  <p>Alternatively, is there a way to just manually get a new token and replace the current one, i.e. <code>myService.ClientCredentials.Renew();</code>?</p>
  
  <p>If I have to make a custom ClientCredentials class to do this, how would I implement the above example methods?</p>