diff --git a/http/routing.hpp b/http/routing.hpp
index 5b819c5..0fa2497 100644
--- a/http/routing.hpp
+++ b/http/routing.hpp
@@ -1275,8 +1275,7 @@
         crow::connections::systemBus->async_method_call(
             [&req, asyncResp, &rules, ruleIndex,
              found](const boost::system::error_code ec,
-                    const std::map<std::string, dbus::utility::DbusVariantType>&
-                        userInfo) {
+                    const dbus::utility::DBusPropertiesMap& userInfoMap) {
                 if (ec)
                 {
                     BMCWEB_LOG_ERROR << "GetUserInfo failed...";
@@ -1284,30 +1283,42 @@
                         boost::beast::http::status::internal_server_error);
                     return;
                 }
-
-                const std::string* userRolePtr = nullptr;
-                auto userInfoIter = userInfo.find("UserPrivilege");
-                if (userInfoIter != userInfo.end())
-                {
-                    userRolePtr =
-                        std::get_if<std::string>(&userInfoIter->second);
-                }
-
                 std::string userRole{};
-                if (userRolePtr != nullptr)
+                const bool* remoteUser = nullptr;
+                std::optional<bool> passwordExpired;
+
+                for (const auto& userInfo : userInfoMap)
                 {
-                    userRole = *userRolePtr;
-                    BMCWEB_LOG_DEBUG << "userName = " << req.session->username
-                                     << " userRole = " << *userRolePtr;
+                    if (userInfo.first == "UserPrivilege")
+                    {
+                        const std::string* userRolePtr =
+                            std::get_if<std::string>(&userInfo.second);
+                        if (userRolePtr == nullptr)
+                        {
+                            continue;
+                        }
+                        userRole = *userRolePtr;
+                        BMCWEB_LOG_DEBUG
+                            << "userName = " << req.session->username
+                            << " userRole = " << *userRolePtr;
+                    }
+                    else if (userInfo.first == "RemoteUser")
+                    {
+                        remoteUser = std::get_if<bool>(&userInfo.second);
+                    }
+                    else if (userInfo.first == "UserPasswordExpired")
+                    {
+                        const bool* passwordExpiredPtr =
+                            std::get_if<bool>(&userInfo.second);
+                        if (passwordExpiredPtr == nullptr)
+                        {
+                            continue;
+                        }
+                        passwordExpired = *passwordExpiredPtr;
+                    }
                 }
 
-                const bool* remoteUserPtr = nullptr;
-                auto remoteUserIter = userInfo.find("RemoteUser");
-                if (remoteUserIter != userInfo.end())
-                {
-                    remoteUserPtr = std::get_if<bool>(&remoteUserIter->second);
-                }
-                if (remoteUserPtr == nullptr)
+                if (remoteUser == nullptr)
                 {
                     BMCWEB_LOG_ERROR
                         << "RemoteUser property missing or wrong type";
@@ -1315,24 +1326,10 @@
                         boost::beast::http::status::internal_server_error);
                     return;
                 }
-                bool remoteUser = *remoteUserPtr;
 
-                bool passwordExpired = false; // default for remote user
-                if (!remoteUser)
+                if (passwordExpired == std::nullopt)
                 {
-                    const bool* passwordExpiredPtr = nullptr;
-                    auto passwordExpiredIter =
-                        userInfo.find("UserPasswordExpired");
-                    if (passwordExpiredIter != userInfo.end())
-                    {
-                        passwordExpiredPtr =
-                            std::get_if<bool>(&passwordExpiredIter->second);
-                    }
-                    if (passwordExpiredPtr != nullptr)
-                    {
-                        passwordExpired = *passwordExpiredPtr;
-                    }
-                    else
+                    if (!*remoteUser)
                     {
                         BMCWEB_LOG_ERROR
                             << "UserPasswordExpired property is expected for"
@@ -1341,6 +1338,7 @@
                             boost::beast::http::status::internal_server_error);
                         return;
                     }
+                    passwordExpired = false;
                 }
 
                 // Get the userprivileges from the role
@@ -1350,7 +1348,7 @@
                 // Set isConfigureSelfOnly based on D-Bus results.  This
                 // ignores the results from both pamAuthenticateUser and the
                 // value from any previous use of this session.
-                req.session->isConfigureSelfOnly = passwordExpired;
+                req.session->isConfigureSelfOnly = *passwordExpired;
 
                 // Modifyprivileges if isConfigureSelfOnly.
                 if (req.session->isConfigureSelfOnly)
