diff options
author | MichaIng <micha@dietpi.com> | 2021-07-12 19:22:04 +0200 |
---|---|---|
committer | MichaIng <micha@dietpi.com> | 2022-07-12 19:19:00 +0200 |
commit | 21b3e87c771987768e0ffe38823e680ff738394f (patch) | |
tree | 0e34f9f85dfafce94212ba35a5eb8b67a616ab5a /lib/private | |
parent | c20d34b2caf6ef030ef52e87311ac96d3fa46931 (diff) | |
download | nextcloud-server-21b3e87c771987768e0ffe38823e680ff738394f.tar.gz nextcloud-server-21b3e87c771987768e0ffe38823e680ff738394f.zip |
Allow SSO authentication to provide a user secret
Implementing PR #24837 from immerda
Signed-off-by: MichaIng <micha@dietpi.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/legacy/OC_User.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php index b7547be5e82..de066e143b4 100644 --- a/lib/private/legacy/OC_User.php +++ b/lib/private/legacy/OC_User.php @@ -178,7 +178,11 @@ class OC_User { } $userSession->setLoginName($uid); $request = OC::$server->getRequest(); - $userSession->createSessionToken($request, $uid, $uid); + $password = null; + if ($backend instanceof \OCP\Authentication\IProvideUserSecretBackend) { + $password = $backend->getCurrentUserSecret(); + } + $userSession->createSessionToken($request, $uid, $uid, $password); $userSession->createRememberMeToken($userSession->getUser()); // setup the filesystem OC_Util::setupFS($uid); @@ -191,7 +195,7 @@ class OC_User { 'post_login', [ 'uid' => $uid, - 'password' => null, + 'password' => $password, 'isTokenLogin' => false, ] ); |