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

Webauthn\PublicKeyCredentialDescriptor::createFromArray(): Argument #1 ($json) must be of type array, Webauthn\ublicKeyCredentialDescriptor given #713

Closed
ChristophWurst opened this issue Jan 15, 2025 · 2 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working

Comments

@ChristophWurst
Copy link
Member

ChristophWurst commented Jan 15, 2025

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

  1. Configure the v2.1.0-beta.1 of the app
  2. Log out
  3. Log in
  4. Select webauthn as second factor
  5. Try to solve the 2FA challenge

Expected behaviour

I pass the 2FA challenge

Actual behaviour

I see a server error.

{
  "reqId": "abc",
  "level": 3,
  "time": "2025-01-15T17:10:48+00:00",
  "remoteAddr": "1.2.3.4",
  "user": "christoph",
  "app": "index",
  "method": "POST",
  "url": "/login/challenge/webauthn?redirect_url=/apps/dashboard/",
  "message": "Webauthn\\PublicKeyCredentialDescriptor::createFromArray(): Argument #1 ($json) must be of type array, Webauthn\\PublicKeyCredentialDescriptor given, called in /var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php on line 184 in file '/var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php' line 96",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0",
  "version": "30.0.5.0",
  "exception": {
    "Exception": "Exception",
    "Message": "Webauthn\\PublicKeyCredentialDescriptor::createFromArray(): Argument #1 ($json) must be of type array, Webauthn\\PublicKeyCredentialDescriptor given, called in /var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php on line 184 in file '/var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php' line 96",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 161,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1007,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 24,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 146,
    "Previous": {
      "Exception": "TypeError",
      "Message": "Webauthn\\PublicKeyCredentialDescriptor::createFromArray(): Argument #1 ($json) must be of type array, Webauthn\\PublicKeyCredentialDescriptor given, called in /var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php on line 184",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php",
          "line": 184,
          "function": "createFromArray",
          "class": "Webauthn\\PublicKeyCredentialDescriptor",
          "type": "::",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/twofactor_webauthn/lib/Service/WebAuthnManager.php",
          "line": 287,
          "function": "createFromArray",
          "class": "Webauthn\\PublicKeyCredentialRequestOptions",
          "type": "::",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/twofactor_webauthn/lib/Provider/WebAuthnProvider.php",
          "line": 100,
          "function": "finishAuthenticate",
          "class": "OCA\\TwoFactorWebauthn\\Service\\WebAuthnManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Authentication/TwoFactorAuth/Manager.php",
          "line": 238,
          "function": "verifyChallenge",
          "class": "OCA\\TwoFactorWebauthn\\Provider\\WebAuthnProvider",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/core/Controller/TwoFactorChallengeController.php",
          "line": 169,
          "function": "verifyChallenge",
          "class": "OC\\Authentication\\TwoFactorAuth\\Manager",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 208,
          "function": "solveChallenge",
          "class": "OC\\Core\\Controller\\TwoFactorChallengeController",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 114,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
          "line": 161,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Route/Router.php",
          "line": 302,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/var/www/nextcloud/lib/base.php",
          "line": 1007,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/index.php",
          "line": 24,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php",
      "Line": 96
    },
    "message": "Webauthn\\PublicKeyCredentialDescriptor::createFromArray(): Argument #1 ($json) must be of type array, Webauthn\\PublicKeyCredentialDescriptor given, called in /var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php on line 184 in file '/var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php' line 96",
    "exception": {},
    "CustomMessage": "Webauthn\\PublicKeyCredentialDescriptor::createFromArray(): Argument #1 ($json) must be of type array, Webauthn\\PublicKeyCredentialDescriptor given, called in /var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php on line 184 in file '/var/www/nextcloud/apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php' line 96"
  }
}

Server configuration

Web server: Apache/Nginx

Database: MySQL/Maria/SQLite/PostgreSQL

PHP version: 8.1/8.2/8.3

Nextcloud version: (see Nextcloud admin page)

List of activated apps
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Nextcloud configuration
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

Browser

Browser name: Firefox/Chrome/Safari/…

Browser version: 124/125/…

Operating system: Windows/Ubuntu/Mac/…

Browser log
@ChristophWurst ChristophWurst added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Jan 15, 2025
@ChristophWurst
Copy link
Member Author

This happened while the instance was patched with nextcloud/server#47396. This could be related.

@ChristophWurst
Copy link
Member Author

It works after revert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant