Basic Authentication with Slim & Eloquent

Hi, i want to use basic authentication with my rest api. I want to check every time my api is called if it is a valid user.
When i send a get with Authentication header there is nothing in my request object… here’s my code:

use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;

$app->get('/api/...', function (Request $request, Response $response) {
    return ...;

Unfortunately there is no authentication in my header… i send the following in my header:
Authorization:Basic dGVzdDp0ZXN0MTIz

How can i use basic auth (in combination with eloquent)?

How is your PHP environment setup? For example, I recall if PHP is running through Apache mod_cgi you will not have access to the authorization headers. For Basic Auth, I’m using @tuupola’s slim-basic-auth package and it works quite well.

Ah okay, i’m using cgi… Can i use tuupola’s package with cgi?

I’m not sure, but it should be pretty fast to pull it in and give it a go.