OpenBMC:BmcWeb login认证
BmcWeb在include\login_routes.hpp中实现了/login用于完成web的登录:
BMCWEB_ROUTE(app, "/login").methods(boost::beast::http::verb::post)(handleLogin);inline void handleLogin(const crow::Request& req,const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{MultipartParser parser;std::string_view contentType = req.getHeaderValue("content-type");std::string_view username;std::string_view password;nlohmann::json loginCredentials;// Check if auth was provided by a payloadif (contentType.starts_with("application/json")){loginCredentials = nlohmann::json::parse(req.body(), nullptr, false);if (loginCredentials.is_discarded())