aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2024-06-07 11:25:36 +0200
committerGitHub <noreply@github.com>2024-06-07 11:25:36 +0200
commit98b5cdc43dfd62e1ceaca6b28ab607d66c1c168e (patch)
treed3ddc97b31be6814be82fc5150d6d0c983246475 /lib/private/legacy
parentef01dc72c1c92bdde6145954fe2a029e90c61e60 (diff)
parentf6d6efef3a26fc5524988cdfba780dce035cd61b (diff)
downloadnextcloud-server-98b5cdc43dfd62e1ceaca6b28ab607d66c1c168e.tar.gz
nextcloud-server-98b5cdc43dfd62e1ceaca6b28ab607d66c1c168e.zip
Merge pull request #43942 from nextcloud/fix/43612/avoid-pwd-confirm-sso
fix(Session): avoid password confirmation on SSO
Diffstat (limited to 'lib/private/legacy')
-rw-r--r--lib/private/legacy/OC_User.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php
index e7708525c76..f9f751f7b14 100644
--- a/lib/private/legacy/OC_User.php
+++ b/lib/private/legacy/OC_User.php
@@ -5,7 +5,9 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
+use OC\Authentication\Token\IProvider;
use OC\User\LoginException;
+use OCP\Authentication\Token\IToken;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IGroupManager;
use OCP\ISession;
@@ -166,6 +168,14 @@ class OC_User {
$userSession->createSessionToken($request, $uid, $uid, $password);
$userSession->createRememberMeToken($userSession->getUser());
+
+ if (empty($password)) {
+ $tokenProvider = \OC::$server->get(IProvider::class);
+ $token = $tokenProvider->getToken($userSession->getSession()->getId());
+ $token->setScope([IToken::SCOPE_SKIP_PASSWORD_VALIDATION => true]);
+ $tokenProvider->updateToken($token);
+ }
+
// setup the filesystem
OC_Util::setupFS($uid);
// first call the post_login hooks, the login-process needs to be