title: How to return 401 authentication from flask API?
body: <p>I have developed an API in flask which is using HttpBasicAuth to authenticate users. API is working absolutely fine in fiddler and returning 401 when we pass wrong credential but when I am using the same on login page I am getting extra pop up from browser. I really don't want to see this extra pop-up which is asking for credential (default behaviour of browser when returning </p>
  
  <blockquote>
    <p><code>401</code></p>
  </blockquote>
  
  <p>with </p>
  
  <blockquote>
    <p><code>WWW-Authenticate: Basic realm="Authentication Required"</code></p>
  </blockquote>
  
  <p>).</p>
  
  <p>It is working fine when deployed locally but not working when hosted on remote server. </p>
  
  <p>How can we implement 401 which will not let browser to display popup asking for credentials.</p>