Skip to content
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

Unable to use webauthn to log in (since Nextcloud 23?) #30549

Open
Derkades opened this issue Jan 8, 2022 · 12 comments
Open

Unable to use webauthn to log in (since Nextcloud 23?) #30549

Derkades opened this issue Jan 8, 2022 · 12 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: authentication needs review Needs review to determine if still applicable

Comments

@Derkades
Copy link

Derkades commented Jan 8, 2022

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

Use the "Log in with a device" feature to log in. After entering a username, and confirming login by pressing the security key's button, nothing happens and the error below is logged to the nextcloud log file:

Error: OC\Core\Controller\WebAuthnController::finishAuthentication(): Argument #1 ($data) 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/core/Controller/WebAuthnController.php' line 95
Full raw backtrace
{
  "reqId": "N6q5uRPmPfYYHYmNrYzw",
  "level": 3,
  "time": "2022-01-08T11:00:08+00:00",
  "remoteAddr": "10.0.1.254",
  "user": "--",
  "app": "index",
  "method": "POST",
  "url": "/login/webauthn/finish",
  "message": "OC\\Core\\Controller\\WebAuthnController::finishAuthentication(): Argument #1 ($data) 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/core/Controller/WebAuthnController.php' line 95",
  "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0",
  "version": "23.0.0.10",
  "exception": {
    "Exception": "Exception",
    "Message": "OC\\Core\\Controller\\WebAuthnController::finishAuthentication(): Argument #1 ($data) 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/core/Controller/WebAuthnController.php' line 95",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 157,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          { "__class__": "OC\\Core\\Controller\\WebAuthnController" },
          "finishAuthentication"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OC\\Core\\Controller\\WebAuthnController",
          "finishAuthentication",
          { "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer" },
          { "_route": "core.WebAuthn.finishAuthentication" }
        ]
      },
      {
        "file": "/var/www/html/lib/base.php",
        "line": 1006,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": ["/login/webauthn/finish"]
      },
      {
        "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": "OC\\Core\\Controller\\WebAuthnController::finishAuthentication(): Argument #1 ($data) 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": "finishAuthentication",
          "class": "OC\\Core\\Controller\\WebAuthnController",
          "type": "->",
          "args": [null]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 126,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            { "__class__": "OC\\Core\\Controller\\WebAuthnController" },
            "finishAuthentication"
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/App.php",
          "line": 157,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            { "__class__": "OC\\Core\\Controller\\WebAuthnController" },
            "finishAuthentication"
          ]
        },
        {
          "file": "/var/www/html/lib/private/Route/Router.php",
          "line": 302,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::",
          "args": [
            "OC\\Core\\Controller\\WebAuthnController",
            "finishAuthentication",
            {
              "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
            },
            { "_route": "core.WebAuthn.finishAuthentication" }
          ]
        },
        {
          "file": "/var/www/html/lib/base.php",
          "line": 1006,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->",
          "args": ["/login/webauthn/finish"]
        },
        {
          "file": "/var/www/html/index.php",
          "line": 36,
          "function": "handleRequest",
          "class": "OC",
          "type": "::",
          "args": []
        }
      ],
      "File": "/var/www/html/core/Controller/WebAuthnController.php",
      "Line": 95
    },
    "CustomMessage": "--"
  },
  "id": "61d97135160fd"
}

Server configuration

Operating system: debian

Web server: nginx

Database: mariadb

PHP version: 8.something

Nextcloud version: 23.0.0

Updated from an older Nextcloud/ownCloud or fresh install: updated

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Firefox 95

Operating system: Kubuntu 21.10

@Derkades Derkades added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jan 8, 2022
@CarlSchwan
Copy link
Member

Hello,
do you have any error messages in the web console? On firefox do a right click -> inspect -> go to the console tab

@Derkades
Copy link
Author

Derkades commented Jan 9, 2022

Browser console:
image

exported to text
No OC found index.js:46:12
Proxying an event bus of version 2.1.1 with 1.3.0 index.es.js:2337:14
JQMIGRATE: Migrate is installed, version 3.3.2 jquery-migrate.min.js:2:708
jQuery is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:62:15
$ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:62:15
jQuery is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 3 globals.js:62:15
$ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:62:15
Backbone is deprecated: please ship your own, this will be removed in Nextcloud 20 globals.js:62:15
Handlebars is deprecated: please ship your own, this will be removed in Nextcloud 20 globals.js:62:15
Proxying an event bus of version 2.1.1 with 1.3.0 index.es.js:2337:14
session heartbeat polling started session-heartbeat.js:101:9
passwordless login initiated PasswordLessLoginForm.vue:107
Obtained PublicKeyCredentialRequestOptions PasswordLessLoginForm.vue:145
Object { challenge: Uint8Array(32), rpId: "cloud.rkslot.nl", userVerification: "discouraged", allowCredentials: (1) […], timeout: 60000 }
PasswordLessLoginForm.vue:146
Converted PublicKeyCredentialRequestOptions PasswordLessLoginForm.vue:161
Object { challenge: Uint8Array(32), rpId: "cloud.rkslot.nl", userVerification: "discouraged", allowCredentials: (1) […], timeout: 60000 }
PasswordLessLoginForm.vue:162
Object { challenge: Uint8Array(32), rpId: "cloud.rkslot.nl", userVerification: "discouraged", allowCredentials: (1) […], timeout: 60000 }
​
allowCredentials: Array [ {…} ]
​​
0: Object { type: "public-key", id: Uint8Array(64) }
​​
length: 1
​​
<prototype>: Array []
​
challenge: Uint8Array(32) [ 62, 96, 182, … ]
​
rpId: "cloud.rkslot.nl"
​
timeout: 60000
​
userVerification: "discouraged"
​
<prototype>: Object { … }
PasswordLessLoginForm.vue:111
GOT AN ERROR! PasswordLessLoginForm.vue:201
DOMException: An attempt was made to use an object that is not, or is no longer, usable PasswordLessLoginForm.vue:202
TIME TO COMPLETE PasswordLessLoginForm.vue:206
GOT AN ERROR WHILE SUBMITTING CHALLENGE! PasswordLessLoginForm.vue:216
Error: Request failed with status code 500
    exports createError.js:16
    exports settle.js:17
    onreadystatechange xhr.js:62
PasswordLessLoginForm.vue:217
jQuery is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 108 globals.js:62:15

@szaimen

This comment was marked as resolved.

@Derkades
Copy link
Author

Derkades commented Jan 9, 2023

I am on 25.0.2, and still get the error 500. This is the error in the server log now:

[index] Error: Exception: OC\Core\Controller\WebAuthnController::finishAuthentication(): Argument #1 ($data) must be of type string, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 225 in file '/var/www/html/core/Controller/WebAuthnController.php' line 88 at <<closure>>

0. /var/www/html/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch(OC\Core\Controller\WebAuthnController {}, "finishAuthentication")
1. /var/www/html/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main("OC\\Core\\Contr ... r", "finishAuthentication", OC\AppFramework\ ... {}, ["core.WebAuthn.finishAuthentication"])
2. /var/www/html/lib/base.php line 1047
   OC\Route\Router->match("/login/webauthn/finish")
3. /var/www/html/index.php line 36
   OC::handleRequest()

POST /login/webauthn/finish
from 10.0.1.254 at 2023-01-09T11:07:58+00:00

Same error message, different line numbers.

@szaimen
Copy link
Contributor

szaimen commented Jan 9, 2023

cc @ChristophWurst

@ItsSiem

This comment was marked as off-topic.

@Mike710Shine

This comment was marked as off-topic.

@joshtrichards
Copy link
Member

joshtrichards commented Dec 18, 2023

@ItsSiem & @Mike710Shine Your issues appear related to each other, but not to the matter reported in this Issue itself. Please create a dedicated issue. Thanks! Also may be same as #37396 which has since been fixed via #37192

@joshtrichards
Copy link
Member

Similar recent in the help forum with NC28 but not using webauthn: https://help.nextcloud.com/t/nextcloud-strange-login-behavior/176981

@joshtrichards joshtrichards added the needs review Needs review to determine if still applicable label Sep 6, 2024
@MrRinkana
Copy link

MrRinkana commented Nov 2, 2024

If you remove and re-add your securitykey(s) on a recent (nc28+) nextcloud version, do you still reproduce this issue @Derkades?

Sidenote, you will need to readd your security keys in nc30+ if you want them to ask for pin (you should, support for asking for pin was added to nc30+) so if you mind readding keys wait until you are on nc30.

EDIT: To be clear the keys need to be readded after an update to key length in the database was made, don't remember what pull request it was.

@major-mayer
Copy link

I had the same problem, getting this 500 error code and no response from the UI.
After I re-added my passkey, this problem was resolved.

@thrustbogdan
Copy link

I pinpointed the answer https://stackdev.space/questions/connecting-javascript-and-php-strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: authentication needs review Needs review to determine if still applicable
Projects
None yet
Development

No branches or pull requests

10 participants