title: C# ADFS SAML token with Windows Auth / Current logged in user
body: <p>How do I generate a SAML token without using credentials again?</p>
  
  <p>Scenario: I am trying to send a SAML token to SAP web service. Since multiple users will be using this application I do not want to ask them for credentials but instead get them from current machine windows credentials and generate a SAML token.  </p>
  
  <p>This is what is currently being used in my code.</p>
  
  <pre><code>factory.Credentials.UserName.UserName = "bob";
  factory.Credentials.UserName.Password = "abc!123";
  
  // create token request
  var rst = new RequestSecurityToken
  {
      RequestType = RequestTypes.Issue,
      KeyType = KeyTypes.Symmetric,
      AppliesTo = new EndpointReference(_serviceAddress.AbsoluteUri)
  };
  </code></pre>