Closed mixtapeco closed 4 years ago
Having trouble implementing this.
Here's my middleware setup:
`use Slim\App;
return function (App $app) { $app->options('/{routes:.+}', function ($request, $response, $args) { return $response; });
$app->add(new Tuupola\Middleware\HttpBasicAuthentication([ "users" => [ "root" => '$2y$10$1lwCIlqktFZwEBIppL4ak.I1AHxjoKy9stLnbedwVMrt92aGz82.O', "somebody" => '$2y$10$6/vGXuMUoRlJUeDN.bUWduge4GhQbgPkm6pfyGxwgEWT0vEkHKBUW' ], ])); $app->add(function ($req, $res, $next) { $response = $next($req, $res); return $response ->withHeader('Access-Control-Allow-Origin', '*') ->withHeader('Access-Control-Expose-Headers', '*') ->withHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, Accept, Origin, Authorization') ->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, PATCH, OPTIONS'); });
}; `
Trying to use basic auth username and password that matches "root" => "$2y$10$1lwCIlqktFZwEBIppL4ak.I1AHxjoKy9stLnbedwVMrt92aGz82.O"
You need to submit the cleartext password not the password hash.
Thank you so much for responding! It worked right away.
No problem :)
Having trouble implementing this.
Here's my middleware setup:
`use Slim\App;
return function (App $app) { $app->options('/{routes:.+}', function ($request, $response, $args) { return $response; });
}; `
Trying to use basic auth username and password that matches "root" => "$2y$10$1lwCIlqktFZwEBIppL4ak.I1AHxjoKy9stLnbedwVMrt92aGz82.O"