title: .NET PricipalContext.ValidateCredentials always returns FALSE
body: <p>I have Domain authentication implemented in the ASP.NET project. Using 4.5 .Net frameworks, 3.0.1 Microsoft.Owin dependencies.</p>
  <p>Here is how I am validating the user trying to login:</p>
  <pre><code>using (var context = new PrincipalContext(ContextType.Domain, domain, username, password))
  {
      ApplicationUser user = UserManager.FindByName(username);
      if (user != null)
      {
          var signInStatus = context.ValidateCredentials(username, password, ContextOptions.SimpleBind);
          // next code based on signInStatus value 
      }
  } 
  </code></pre>
  <p>I tried many answers on Stack Overflow but nothing worked for me. Any help will be very much appreciated.</p>
  <p><strong>EDIT</strong></p>
  <p>I looked into the <code>PrincipalContext.validateCredentials</code> <a href="https://github.com/dotnet/runtime/blob/master/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Context.cs#L327" rel="nofollow noreferrer">method</a> and found that it returns false when app receives <code>LdapException</code>. Does anyone know why LdapException comes? Am I missing something in configuration?</p>