title: PHP - REST - Slim Framework HTTP Basic Auth - 401 Unauthorized
body: <p>I want to implement HTTP-Basic-Authentication in my REST API (PHP - Slim Framework).
  If I send a POST Request to the protected URL, it shows a window 'Authentication required', where I can fill in my credentials, but I always get an error 
  <em>401 Unauthorized</em>.</p>
  
  <pre><code>$app-&gt;add(new \Slim\Middleware\HttpBasicAuthentication([
  "path" =&gt; "/api/v1/video/add",
  "realm" =&gt; "Protected",
  "secure" =&gt; false,
  "users" =&gt; [
      "root" =&gt; "root123",
      "user" =&gt; "user"
  ]
  ]));
  </code></pre>
  
  <p>route:</p>
  
  <pre><code>$app-&gt;post('/api/v1/video/add', function (Request $request, Response $response) {
  
  // get POST-Variables
  $allPostVars = $request-&gt;getParsedBody(); 
  $id = $allPostVars['id'];
  [....]
  }
  </code></pre>