twofactor_yubikey icon indicating copy to clipboard operation
twofactor_yubikey copied to clipboard

Breaks Nextcloud 21

Open agross opened this issue 4 years ago • 7 comments

I just upgraded to Nextcloud 21. With Yubikey enabled users cannot use the web UI (sync clients still work).

This the logged (formatted):

{
    "reqId": "lmNptdBY6dbXJweETGGT",
    "level": 3,
    "time": "2021-02-22T17:06:10+01:00",
    "remoteAddr": "2004:480:1f0b:c9a:5ce0:b75f:9282:6cf",
    "user": "agross",
    "app": "index",
    "method": "GET",
    "url": "/apps/photos/service-worker.js",
    "message": {
        "Exception": "Exception",
        "Message": "Could not load two-factor auth provider OCA\\TwoFactor_Yubikey\\Provider\\YubikeyProvider",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/html/lib/private/Authentication/TwoFactorAuth/Manager.php",
                "line": 119,
                "function": "getProviders",
                "class": "OC\\Authentication\\TwoFactorAuth\\ProviderLoader",
                "type": "->",
                "args": [
                    {
                        "__class__": "OC\\User\\User"
                    }
                ]
            },
            {
                "file": "/var/www/html/core/Middleware/TwoFactorMiddleware.php",
                "line": 115,
                "function": "isTwoFactorAuthenticated",
                "class": "OC\\Authentication\\TwoFactorAuth\\Manager",
                "type": "->",
                "args": [
                    {
                        "__class__": "OC\\User\\User"
                    }
                ]
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php",
                "line": 98,
                "function": "beforeController",
                "class": "OC\\Core\\Middleware\\TwoFactorMiddleware",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Photos\\Controller\\ApiController"
                    },
                    "serviceWorker"
                ]
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 119,
                "function": "beforeController",
                "class": "OC\\AppFramework\\Middleware\\MiddlewareDispatcher",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Photos\\Controller\\ApiController"
                    },
                    "serviceWorker"
                ]
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/App.php",
                "line": 157,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Photos\\Controller\\ApiController"
                    },
                    "serviceWorker"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Route/Router.php",
                "line": 302,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::",
                "args": [
                    "OCA\\Photos\\Controller\\ApiController",
                    "serviceWorker",
                    {
                        "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                    },
                    {
                        "_route": "photos.api.serviceWorker"
                    }
                ]
            },
            {
                "file": "/var/www/html/lib/base.php",
                "line": 993,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->",
                "args": [
                    "/apps/photos/service-worker.js"
                ]
            },
            {
                "file": "/var/www/html/index.php",
                "line": 37,
                "function": "handleRequest",
                "class": "OC",
                "type": "::",
                "args": []
            }
        ],
        "File": "/var/www/html/lib/private/Authentication/TwoFactorAuth/ProviderLoader.php",
        "Line": 69,
        "CustomMessage": "--"
    },
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36",
    "version": "21.0.0.18"
}

agross avatar Feb 22 '21 16:02 agross

It looks like something has changed in the way a plugin needs to register with the autoloader. I'm gonna have to take some time to figure out how to make it work in version 21.

jaark avatar Feb 22 '21 23:02 jaark

Any update to this?

Tarry91 avatar Mar 11 '21 10:03 Tarry91

Same problem here. Was able to disable the plugin using command line occ on the server; but note that if that is the only two factor module that's enabled and 2fa is required to log in, you will be locked out of nextcloud.

sudo -u www-data php occ app:disable twofactor_yubikey

(see the manual for more info about how to run the occ)

flabbergast avatar Apr 10 '21 09:04 flabbergast

Is there any news about this issue. @jaark

81pla avatar May 20 '21 03:05 81pla

Any news about this issue ? Just got a 12 hours of downtime on a production installation due to twofactor_yubikey enabled and snap installed automatically NC21 !

rleo79 avatar May 20 '21 14:05 rleo79

here we are in 2022, anything new yet? @jaark

My1 avatar Jan 11 '22 11:01 My1

+1 Bump

adamboutcher avatar Jun 15 '22 16:06 adamboutcher