title: How to get the current user credential?
body: <p>I want to create a NetworkCredential based on the logged in user like:</p>
  
  <pre><code>var cred = new NetworkCredential("username", "password", "domain");
  </code></pre>
  
  <p>Usually the code is running on a system which the user is logged in using his/her password. So I don't want to get the password again. My question has 2 parts:</p>
  
  <p><strong>Question 1.</strong> Is there a way to get the current Credential for Desktop applications? Something like:</p>
  
  <pre><code>var cred = NetworkCredential.Current;
  </code></pre>
  
  <p><strong>Question 2.</strong> In a web SPA application, how can I pass the credential to the server via WebApi so I can do the work using his/her credential?</p>