如何将所有数据库用户设置为苗条的基本身份验证中间件

时间:2018-10-17 06:54:36

标签: php authentication slim middleware

$app->add(new Tuupola\Middleware\HttpBasicAuthentication([

    "path" => "/api",
    "realm" => "Protected",
    "users" => [
        "Username" => "kavi",
        "password" => "0000"
    ],
    "error" => function ($response, $arguments) {
      echo "false";
        $data = [];
        $data["status"] = "error";
        $data["message"] = $arguments["message"];
        // return $response->write(json_encode($data, JSON_UNESCAPED_SLASHES));
    },
    "success"=>function($response, $arguments){
        echo "true";
    }

]));

0 个答案:

没有答案