summaryrefslogtreecommitdiff
path: root/include/sessions.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/sessions.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/sessions.hpp')
-rw-r--r--include/sessions.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/sessions.hpp b/include/sessions.hpp
index 85d8ecc635..a448b24c0f 100644
--- a/include/sessions.hpp
+++ b/include/sessions.hpp
@@ -210,10 +210,10 @@ class SessionStore
{
public:
std::shared_ptr<UserSession> generateUserSession(
- const std::string_view username,
+ const std::string_view username, const std::string_view clientIp,
+ const std::string_view clientId,
PersistenceType persistence = PersistenceType::TIMEOUT,
- bool isConfigureSelfOnly = false, const std::string_view clientId = "",
- const std::string_view clientIp = "")
+ bool isConfigureSelfOnly = false)
{
// TODO(ed) find a secure way to not generate session identifiers if
// persistence is set to SINGLE_REQUEST