]> source.dussan.org Git - nextcloud-server.git/commitdiff
Discourage webauthn user interaction 21880/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Thu, 16 Jul 2020 19:10:07 +0000 (21:10 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 16 Jul 2020 19:10:07 +0000 (21:10 +0200)
Else people might have the feeling this is also doing 2FA. And since it
is only prefered it can be ignored and hacked around.

Once we have proper 2FA with webauthn in one go this probably needs to
be revisted.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/Authentication/WebAuthn/Manager.php

index cc3e9aba1cc9c82aea90d0826765e4619ffb08b0..4415badc9b0761259de64cdd32cb1795048c1589 100644 (file)
@@ -107,7 +107,11 @@ class Manager {
                $excludedPublicKeyDescriptors = [
                ];
 
-               $authenticatorSelectionCriteria = new AuthenticatorSelectionCriteria();
+               $authenticatorSelectionCriteria = new AuthenticatorSelectionCriteria(
+                       null,
+                       false,
+                       AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_DISCOURAGED
+               );
 
                return new PublicKeyCredentialCreationOptions(
                        $rpEntity,
@@ -186,7 +190,8 @@ class Manager {
                        random_bytes(32),                                                    // Challenge
                        60000,                                                              // Timeout
                        $this->stripPort($serverHost),                                                                  // Relying Party ID
-                       $registeredPublicKeyCredentialDescriptors                                  // Registered PublicKeyCredentialDescriptor classes
+                       $registeredPublicKeyCredentialDescriptors,                                  // Registered PublicKeyCredentialDescriptor classes
+                       AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_DISCOURAGED
                );
        }