title: Basic Authentication URL Handling
body: <p>We have a new b2b vendor that wants to use basic auth via URL. </p>
  
  <p>They want to authenticate like this:     </p>
  
  <pre><code>  //URL coming into our server
    http://usernametext:passwordtext@our.company.com/listener.php
  </code></pre>
  
  <p>How can I get the username and password from the URL via my listener.php script?</p>
  
  <p>I have tried setting basic auth headers per the php man page but it pops up a login box, which is not what I need, since these are web services talking to each other, not people:</p>
  
  <pre><code>if (!isset($_SERVER['PHP_AUTH_USER'])) {
       header('WWW-Authenticate: Basic realm="My Realm"');
       header('HTTP/1.0 401 Unauthorized');
       echo '&lt;response&gt;&lt;error&gt;No username and password found&lt;/error&gt;&lt;/response&gt;';
       exit;
   } else {
  
     //process request if username &amp; password are legit
  
  }
  </code></pre>