From bc0736a9a51741952f2d6fccf78d9272ccb71025 Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 17 Feb 2025 12:03:21 +0100 Subject: [PATCH] fix not working stored password for SSO --- api/src/Session.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/src/Session.php b/api/src/Session.php index e00ff437a9..1095f85d4b 100644 --- a/api/src/Session.php +++ b/api/src/Session.php @@ -328,9 +328,11 @@ class Session */ public function __set($name, $value) { - if ($name === 'passwd') + if ($name === 'passwd' && !empty($value)) { - $this->password_encrypted = Mail\Credentials::encrypt($value, $this->account_id, $pw_enc, true); + // we also need to update it in session, as extra SSO password uses the hook "session_created" running after call to register_session! + $_SESSION[self::EGW_SESSION_VAR]['session_password'] = $this->password_encrypted = + Mail\Credentials::encrypt($value, $this->account_id, $pw_enc, true); $this->_password = $value; } } @@ -2057,7 +2059,6 @@ class Session $user['account_id'] = $this->account_id; $user['account_lid'] = $this->account_lid; $user['userid'] = $this->account_lid; - $user['passwd'] = $this->passwd; return $user; }