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) {
var_dump($request->getHeaders());
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)?