title: How to make the browser prompt for default user authentication pop up?
body: <p>I have a MVC application in C#. I need it to prompt the default browser authentication login popup as below image.</p>
  
  <p><a href="https://i.stack.imgur.com/HJA4E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HJA4E.png" alt="enter image description here"></a> </p>
  
  <p>Then the application supposed to validate it with the Active Directory and get some other information regarding the user from the AD.</p>
  
  <p>I have no issue in validating and getting the user information from AD if I have the username.</p>
  
  <p>So my question is how can I make the browser prompt such modal dialog and how can I access the user's input to validate it with my AD?</p>
  
  <p>Here is what I have so far. The code will only get the username from the logon user and won't prompt the pop up: </p>
  
  <pre><code>private string GetUsernameFromLogon()
      {
          string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
          int index = userName.LastIndexOf("\\");
          if (index &gt; 0)
              return userName.Substring(index+1);
          else
              return null;
      }
  </code></pre>