title: WCF Service with Active Directory Authentication
body: <p>I am writing a WCF Service which would allow access to operations based on AD user group. If the logged in user is part of <code>groupA</code>, allow him to do <code>operationA</code>, but not <code>operationB</code> and so on and so forth. Now for this I have to pass <code>NetworkCredentials</code> to the service like</p>
  
  <pre><code>factory.Credentials.Windows.AllowedImpersonationLevel = 
                       TokenImpersonationLevel.Identification;
  factory.Credentials.Windows.AllowNtlm = true;
  factory.Credentials.Windows.ClientCredential.username = "username";
  factory.Credentials.Windows.ClientCredential.password = "pwd";
  factory.Credentials.Windows.ClientCredential.domain = "mycompany.com";
  </code></pre>
  
  <p>I want that the user need not enter his credentials for calling service operation. It should take from <code>Thread.CurrentPrincipal</code>. Can anyone help me out in this regards as to how to pass network credentials.</p>