jaark / twofactor_yubikey

Yubikey Two-factor authentication provider for NextCloud
GNU Affero General Public License v3.0
21 stars 7 forks source link

Breaks Nextcloud 21 #26

Open agross opened 3 years ago

agross commented 3 years ago

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"
}
jaark commented 3 years ago

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.

Tarry91 commented 3 years ago

Any update to this?

flabbergast commented 3 years ago

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)

81pla commented 3 years ago

Is there any news about this issue. @jaark

rleo79 commented 3 years ago

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 !

My1 commented 2 years ago

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

adamboutcher commented 2 years ago

+1 Bump