-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passwordless Authentication Fails in clean NC Installation #27662
Comments
Intermediate fix if you absolutely need this to work right now: In public function saveAndReturnCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource, string $name = null): PublicKeyCredentialEntity {
$oldEntity = null;
try {
$oldEntity = $this->credentialMapper->findOneByCredentialId($publicKeyCredentialSource->getPublicKeyCredentialId());
} catch (IMapperException $e) {
}
$defaultName = false;
if ($name === null) {
$defaultName = true;
$name = 'default';
}
$entity = PublicKeyCredentialEntity::fromPublicKeyCrendentialSource($name, $publicKeyCredentialSource);
if ($oldEntity) {
$entity->setId($oldEntity->getId());
if ($defaultName) {
$entity->setName($oldEntity->getName());
}
+ return $this->credentialMapper->update($entity);
}
- return $this->credentialMapper->insertOrUpdate($entity);
+ return $this->credentialMapper->insert($entity);
} Sorry for the poor-man's diff ;-) |
thks, great analysis + workaround fixed it for me! |
@brueckner worked for me as well. However, I notice that the syncing clients (Linux and Windows) started to log out and unable to keep a login for more than a few minutes. |
@simao-silva yes, same here |
@brueckner I have reverted your proposed changes from here AND reverted the changes from here #26581 -> webauthn is still working but I have also still the issue that the sync client is logged out after a few minutes.... |
For 22 the code looks fine, I think only 21 is a problem. 21: https://github.com/nextcloud/server/blame/e76b83393cf95c0ac97850f9487ab3ddc7bf604b/lib/public/AppFramework/Db/QBMapper.php#L139
This also has to do with #26182 |
Ugh. There is a lot that doesn't seem right with documented vs actually thrown exceptions in Nextcloud 21. If you start to fix one place then it has influence on so many other code snippets. I think I'll open a PR that just addresses this specific bug and then we hope for the best 🤞 |
@simao-silva regarding the sync client issue....if I authenticate my users with passwords in the browser before allowing the access to the sync client, it keeps the connection..... @ChristophWurst: any idea how to track this down? |
No, I don't see how those two bugs are related. |
Can anyone try again with NC22 if it works there? |
Lets track this in #26806 then |
Steps to reproduce
Expected behaviour
You should get logged on.
Actual behaviour
You are not logged in. Nothing visible to the user happens. No error message, nothing.
Server configuration
Operating system: Linux 5.4.0-70-generic x86_64
Web server: Apache 2.4.38
Database: MySQL 8.0.23
PHP version: 8.0.7
Nextcloud version: (see Nextcloud admin page) 21.0.2
Updated from an older Nextcloud/ownCloud or fresh install: fresh install
Where did you install Nextcloud from: ZIP file from the download page
List of activated apps:
App list
Are you using external storage, if yes which one: no
Are you using encryption: yes
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: Chrome 91
Operating system: MacOS 11.3.1
Logs
Nextcloud log (data/nextcloud.log)
Nextcloud log
The part that matters is this one:
I tracked down the problem and it seems to come from the
insertOrUpdate()
function inQBMapper.php
:server/lib/public/AppFramework/Db/QBMapper.php
Lines 162 to 171 in bdfd2d9
It tries to catch the exception:
but seems to fail to do so. Tracking it down further, we can see that
Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION
... has been added in version 21.0.0:
server/lib/public/DB/Exception.php
Lines 134 to 139 in bdfd2d9
So I guess that code
14
mit not be correct?!The text was updated successfully, but these errors were encountered: