authentication.hpp (89492a157c9cf972b342421e24d41fd382510251) authentication.hpp (1d869608fb671a2c5e80563c9fa8c630aa728346)
1#pragma once
2
3#include "common.hpp"
4#include "forward_unauthorized.hpp"
5#include "http_request.hpp"
6#include "http_response.hpp"
7#include "http_utility.hpp"
8#include "pam_authenticate.hpp"

--- 110 unchanged lines hidden (view full) ---

119 auto sessionOut =
120 persistent_data::SessionStore::getInstance().loginSessionByToken(token);
121 return sessionOut;
122}
123#endif
124
125#ifdef BMCWEB_ENABLE_COOKIE_AUTHENTICATION
126static std::shared_ptr<persistent_data::UserSession>
1#pragma once
2
3#include "common.hpp"
4#include "forward_unauthorized.hpp"
5#include "http_request.hpp"
6#include "http_response.hpp"
7#include "http_utility.hpp"
8#include "pam_authenticate.hpp"

--- 110 unchanged lines hidden (view full) ---

119 auto sessionOut =
120 persistent_data::SessionStore::getInstance().loginSessionByToken(token);
121 return sessionOut;
122}
123#endif
124
125#ifdef BMCWEB_ENABLE_COOKIE_AUTHENTICATION
126static std::shared_ptr<persistent_data::UserSession>
127 performCookieAuth(boost::beast::http::verb method,
127 performCookieAuth(boost::beast::http::verb method [[maybe_unused]],
128 const boost::beast::http::header<true>& reqHeader)
129{
130 BMCWEB_LOG_DEBUG << "[AuthMiddleware] Cookie authentication";
131
132 std::string_view cookieValue = reqHeader["Cookie"];
133 if (cookieValue.empty())
134 {
135 return nullptr;

--- 172 unchanged lines hidden ---
128 const boost::beast::http::header<true>& reqHeader)
129{
130 BMCWEB_LOG_DEBUG << "[AuthMiddleware] Cookie authentication";
131
132 std::string_view cookieValue = reqHeader["Cookie"];
133 if (cookieValue.empty())
134 {
135 return nullptr;

--- 172 unchanged lines hidden ---