summaryrefslogtreecommitdiff
path: root/include/login_routes.hpp
diff options
context:
space:
mode:
authorSunitha Harish <sunithaharish04@gmail.com>2021-02-24 13:03:29 +0300
committerEd Tanous <ed@tanous.net>2021-03-11 18:30:40 +0300
commitd32392249b1538e0b0a76f20bf602e683f636fb6 (patch)
tree80c094bf67510ba4f352c6adbc5887fd3b7e0e48 /include/login_routes.hpp
parentefb8062c306474942bc94f15d748b2eb0b58fbb6 (diff)
downloadbmcweb-d32392249b1538e0b0a76f20bf602e683f636fb6.tar.xz
Redfish Session : Fix clientIp getting mapped to clientId
When the session is created using /login, the ClientOriginIPAddress is mapped to the clientId parameter which displayed the clientIP instead of the of clientId. The similar problem is observed with auth methods other than sessions created using the SessionService resource This commit swaps the clientId and clientIp parameters passed to generateUserSession API, so that the optional clientId is passed as the last parameter Tested by : 1. Create session using Redfish command POST https://${bmc}/login -d '{"username": <>,"password": <>}' POST https://${bmc}/redfish/v1/SessionService/Sessions -d '{"username": <>,"password": <>}' 2. Open the GUI session to check the clientId is not displaying the ClientOriginIPAddress Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I6cee3de963c489e690d2ad0bb09ba78dca39e4f9
Diffstat (limited to 'include/login_routes.hpp')
-rw-r--r--include/login_routes.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/login_routes.hpp b/include/login_routes.hpp
index 6879de0d47..d4005599bb 100644
--- a/include/login_routes.hpp
+++ b/include/login_routes.hpp
@@ -136,12 +136,14 @@ inline void requestRoutes(App& app)
}
else
{
+ std::string unsupportedClientId = "";
auto session =
persistent_data::SessionStore::getInstance()
.generateUserSession(
- username,
+ username, req.ipAddress.to_string(),
+ unsupportedClientId,
persistent_data::PersistenceType::TIMEOUT,
- isConfigureSelfOnly, req.ipAddress.to_string());
+ isConfigureSelfOnly);
if (looksLikePhosphorRest)
{