HTTP Basic Authentication
$app->pipe->addMiddleWare(
new AuthBasicMiddleware(new \Brace\Auth\Basic\Validator\LambdaAuthValidator(
function (\Brace\Auth\Basic\BasicAuthToken $basicAuthToken) {
return $basicAuthToken->user === "client1" && $basicAuthToken->passwd === "test";
}
))
);
$app->pipe->addMiddleWare(
new AuthBasicMiddleware(new ClientIdFileAuthValidator(CONFIG_PATH . "/clients.yml"))
);
Dont't forget to call
$basicAuthToken->validate();
To verify the Token is valid