-
Notifications
You must be signed in to change notification settings - Fork 0
NextCloud stopped authenticating with U2F #9
Comments
Possible fix for U2F authentication issues. status-im/infra-office#9 Signed-off-by: Jakub Sokołowski <[email protected]>
I have upgraded the NextCloud image to |
And I see this error in main log: {
"reqId": "OETlnUZWzvgOmRgz3Zc6",
"level": 3,
"time": "2022-02-21T14:43:56+00:00",
"remoteAddr": "172.17.9.1",
"user": "jakub",
"app": "index",
"method": "POST",
"url": "/index.php/apps/twofactor_u2f/settings/finishregister",
"message": "OCA\\TwoFactorU2F\\Controller\\SettingsController::finishRegister(): Argument #1 ($registrationData) must be of type string, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 217 in file /var/www/html/custom_apps/twofactor_u2f/lib/Controller/SettingsController.php line 65",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36",
"version": "23.0.0.10",
"exception": {
"Exception": "Exception",
"Message": "OCA\\TwoFactorU2F\\Controller\\SettingsController::finishRegister(): Argument #1 ($registrationData) must be of type string, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 217 in file /var/www/html/custom_apps/twofactor_u2f/lib/Controller/SettingsController.php line 65",
"Code": 0,
"Trace": [
{ "file": "/var/www/html/lib/private/AppFramework/App.php", "line": 157, "function": "dispatch", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ { "__class__": "OCA\\TwoFactorU2F\\Controller\\SettingsController" }, "finishRegister" ] },
{ "file": "/var/www/html/lib/private/Route/Router.php", "line": 302, "function": "main", "class": "OC\\AppFramework\\App", "type": "::", "args": [ "OCA\\TwoFactorU2F\\Controller\\SettingsController", "finishRegister", { "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer" }, { "_route": "twofactor_u2f.settings.finishRegister" } ] },
{ "file": "/var/www/html/lib/base.php", "line": 1006, "function": "match", "class": "OC\\Route\\Router", "type": "->", "args": [ "/apps/twofactor_u2f/settings/finishregister" ] },
{ "file": "/var/www/html/index.php", "line": 36, "function": "handleRequest", "class": "OC", "type": "::", "args": [] }
],
"File": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"Line": 158,
"Previous": {
"Exception": "TypeError",
"Message": "OCA\\TwoFactorU2F\\Controller\\SettingsController::finishRegister(): Argument #1 ($registrationData) must be of type string, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 217",
"Code": 0,
"Trace": [
{ "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 217, "function": "finishRegister", "class": "OCA\\TwoFactorU2F\\Controller\\SettingsController", "type": "->", "args": [ null, null, "YubiKey" ] },
{ "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 126, "function": "executeController", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ { "__class__": "OCA\\TwoFactorU2F\\Controller\\SettingsController" }, "finishRegister" ] },
{ "file": "/var/www/html/lib/private/AppFramework/App.php", "line": 157, "function": "dispatch", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ { "__class__": "OCA\\TwoFactorU2F\\Controller\\SettingsController" }, "finishRegister" ] },
{ "file": "/var/www/html/lib/private/Route/Router.php", "line": 302, "function": "main", "class": "OC\\AppFramework\\App", "type": "::", "args": [ "OCA\\TwoFactorU2F\\Controller\\SettingsController", "finishRegister", { "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer" }, { "_route": "twofactor_u2f.settings.finishRegister" } ] },
{ "file": "/var/www/html/lib/base.php", "line": 1006, "function": "match", "class": "OC\\Route\\Router", "type": "->", "args": [ "/apps/twofactor_u2f/settings/finishregister" ] },
{ "file": "/var/www/html/index.php", "line": 36, "function": "handleRequest", "class": "OC", "type": "::", "args": [] }
],
"File": "/var/www/html/custom_apps/twofactor_u2f/lib/Controller/SettingsController.php",
"Line": 65
},
"CustomMessage": "--"
}
} |
If we look at logs from Serhan's login attempt there's no errors:
|
I tried updating plugins but none of the
|
I can see @serhanwbahar has all 3 available two factor auth options enabled:
|
I think I can disable
|
It worked:
@serhanwbahar can you try logging in using a different method and then adding U2F again? |
This issue looks imilar:
But there the error is :
And our error is:
|
Ooh, this looks more promising:
|
Except we already have that in the config:
|
I tried editing There's also |
Upgraded NextCloud to |
Okay, looks like my modification of |
Also had to manually run command to add missing indices:
|
Still not working, but now I see an error like this:
Which seems to be a known issue:
Which suggests the important setting is |
Also added |
When I try to add my YubiKey as WebAuthN I get this:
Which based on the link suggests that the issue is with configuration of WebAuthN Relying Party:
|
Opened an issue for the WebAuthN timeout errors: nextcloud/twofactor_webauthn#146 But I just successfully managed to add my YubiKey on my laptop, so this might be something client-side. But U2F addition doesn't work on the laptop as well. |
I've added dome debugging prints to the code to check the values, and when the payload for The
Where public function finishRegister(string $registrationData, string $clientData, string $name = null): JSONResponse {
return new JSONResponse($this->manager->finishRegistration($this->userSession->getUser(), $registrationData, $clientData, $name));
} So we're clearly missing |
Interesting. When I put a debug line here: $this->logger->info("WTF param: $param -> '$value' ($type)"); I can see that the arguments are all of type
But then the first two empty strings get turned into |
From my debugging it appears that after this line: $arguments[] = $value; https://github.com/nextcloud/server/blob/v23.0.3/lib/private/AppFramework/Http/Dispatcher.php#L214 The empty string turns into |
This is interesting, apparently U2F is deprecated in favor of WebAuthN:
So maybe we should just disable it. |
Some setup improvements:
I'm starting to think it would make more sense jut to disable U2F in favor of WebAuthN. |
status-im/infra-office#9 Signed-off-by: Jakub Sokołowski <[email protected]>
status-im/infra-office#9 Signed-off-by: Jakub Sokołowski <[email protected]>
As far as I can tell there are two ways to use WebAuthN in Next Cloud: WebAuthN ModuleWebAuthN Paswordless NativeThe latter comes with NextCloud, the former is an application you install. The main difference is that the native method does not require the password to be provided: Which tells me that maybe the app version is better. |
The native support allows for passwordless login, but we'd rather prompt for password before verifying with WebAuthN device as second factor. status-im/infra-office#9 (comment) Signed-off-by: Jakub Sokołowski <[email protected]>
I've disabled native WebAuthN extension and added the app to config: https://github.com/status-im/infra-office/commit/5afbc3bc |
I didn't fix the issue, but I've wasted enough time on this considering U2F is deprecated. Closing. |
Currently attempts to authenticate with 2FA fail on our NextCloud instance as reported by @serhanwbahar.
The text was updated successfully, but these errors were encountered: