Skip to content

Commit ba67e10

Browse files
tsdicloudilya.dokshukin@iits-consulting.de
authored andcommitted
Patch token invalidation when OpenId COnnect is used, nextcloud#27886
We observer token invalidations random for OpenId Connect users and early apply the fix for nextcloud#27886 Signed-off-by: Bernd.Rederlechner@t-systems.com <bernd.rederlechner@t-systems.com>
1 parent 3641523 commit ba67e10

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

lib/private/Authentication/Listeners/UserLoggedInListener.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public function handle(Event $event): void {
4848
return;
4949
}
5050

51+
// prevent setting an empty pw as result of pw-less-login
52+
if ($event->getPassword() === '') {
53+
return;
54+
}
55+
5156
// If this is already a token login there is nothing to do
5257
if ($event->isTokenLogin()) {
5358
return;

lib/private/Authentication/Token/PublicKeyTokenProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ public function markPasswordInvalid(IToken $token, string $tokenId) {
415415
public function updatePasswords(string $uid, string $password) {
416416
$this->cache->clear();
417417

418+
// prevent setting an empty pw as result of pw-less-login
419+
if ($password === '') {
420+
return;
421+
}
422+
418423
// Update the password for all tokens
419424
$tokens = $this->mapper->getTokenByUser($uid);
420425
foreach ($tokens as $t) {

0 commit comments

Comments
 (0)