nextcloud / user_saml

:lock: App for authenticating Nextcloud users using SAML https://apps.nextcloud.com/apps/user_saml
https://portal.nextcloud.com/article/configuring-single-sign-on-10.html
GNU Affero General Public License v3.0
96 stars 76 forks source link

Call to undefined method OCA\User_SAML\UserBackend::checkPassword() #826

Closed blizzz closed 8 months ago

blizzz commented 8 months ago

Well now I have another error, this time with impact :

[webdav] Erreur: Call to undefined method OCA\User_SAML\UserBackend::checkPassword() PROPFIND /remote.php/dav/files/admin/ de 10.97.50.2 par -- à 21 mars 2024, 15:15:27

Impact is nextcloud windows client can no longer connect. I have the last stable version 3.12.2.

_Originally posted by @Alakadoo in https://github.com/nextcloud/user_saml/issues/825#issuecomment-2012459798_

blizzz commented 8 months ago

@Alakadoo can you check your nextcloud.log for this error? Hopefully there is some backtrace included.

KnudH commented 8 months ago

Same here

Complete Errormessage: {"reqId":"jF4jdaqCdodNbZYCDWm6","level":3,"time":"2024-03-23T00:09:27+00:00","remoteAddr":"XXX","user":"--","app":"index","method":"POST","url":"/login","message":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword() in file '/var/www/html/lib/private/User/Manager.php' line 265","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0","version":"28.0.3.2","exception":{"Exception":"Exception","Message":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword() in file '/var/www/html/lib/private/User/Manager.php' line 265","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\LoginController"],"tryLogin"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\LoginController","tryLogin",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["core.login.tryLogin"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/login"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"Error","Message":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword()","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php","line":46,"function":"checkPasswordNoLogging","class":"OC\\User\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php","line":39,"function":"process","class":"OC\\Authentication\\Login\\UidLoginCommand","type":"->","args":[["OC\\Authentication\\Login\\LoginData"]]},{"file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php","line":57,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->","args":[["OC\\Authentication\\Login\\LoginData"]]},{"file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php","line":39,"function":"process","class":"OC\\Authentication\\Login\\UserDisabledCheckCommand","type":"->","args":[["OC\\Authentication\\Login\\LoginData"]]},{"file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php","line":52,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->","args":[["OC\\Authentication\\Login\\LoginData"]]},{"file":"/var/www/html/lib/private/Authentication/Login/Chain.php","line":107,"function":"process","class":"OC\\Authentication\\Login\\PreLoginHookCommand","type":"->","args":[["OC\\Authentication\\Login\\LoginData"]]},{"file":"/var/www/html/core/Controller/LoginController.php","line":310,"function":"process","class":"OC\\Authentication\\Login\\Chain","type":"->","args":[["OC\\Authentication\\Login\\LoginData"]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"tryLogin","class":"OC\\Core\\Controller\\LoginController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\LoginController"],"tryLogin"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\LoginController"],"tryLogin"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\LoginController","tryLogin",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["core.login.tryLogin"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/login"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/User/Manager.php","Line":265},"message":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword() in file '/var/www/html/lib/private/User/Manager.php' line 265","exception":[],"CustomMessage":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword() in file '/var/www/html/lib/private/User/Manager.php' line 265"},"id":"65fe1dba10784"}

smotschnig commented 8 months ago

Same here. If I try to log in with my email address, I will get the following output.

{"reqId":"OaLyo12gkYW1GIs0MypK","level":3,"time":"2024-03-26T07:33:06+01:00","remoteAddr":"192.168.10.152","user":"--","app":"index","method":"POST","url":"/login","message":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword() in file '/var/www/nextcloud/lib/private/User/Manager.php' line 265","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","version":"28.0.3.2","exception":{"Exception":"Exception","Message":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword() in file '/var/www/nextcloud/lib/private/User/Manager.php' line 265","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"Error","Message":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword()","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php","line":48,"function":"checkPasswordNoLogging","class":"OC\\User\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":39,"function":"process","class":"OC\\Authentication\\Login\\UidLoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php","line":57,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":39,"function":"process","class":"OC\\Authentication\\Login\\UserDisabledCheckCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php","line":52,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/Chain.php","line":107,"function":"process","class":"OC\\Authentication\\Login\\PreLoginHookCommand","type":"->"},{"file":"/var/www/nextcloud/core/Controller/LoginController.php","line":310,"function":"process","class":"OC\\Authentication\\Login\\Chain","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"tryLogin","class":"OC\\Core\\Controller\\LoginController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/User/Manager.php","Line":265},"message":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword() in file '/var/www/nextcloud/lib/private/User/Manager.php' line 265","exception":{},"CustomMessage":"Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword() in file '/var/www/nextcloud/lib/private/User/Manager.php' line 265"}}

If I try to log in with my username, everything works fine. However, if I input a wrong username or wrong password, I receive an internal server error message. It does not indicate something like a wrong password or user not found.

jecal22 commented 8 months ago

I've been getting these errors in my nextcloud.log file. These began on 3/23. Analyzing the logs, there were 485 occurrences between 3/23 and 3/24. Between 3/24-3/28 there have been 161,787 occurrences of the same error.

Unlike the other reports here which show the URL as /login, my errors appear to be from the webdav app and the URL is remote.php. This is the latest log entry:

I've been getting these errors in my nextcloud.log file. These began on 3/23. Analyzing the logs, there were 485 occurrences between 3/23 and 3/24. Between 3/24-3/28 there have been 161,787 occurrences of the same error.

Unlike the other reports here which show the URL as /login, my errors appear to be from the webdav app and the URL is remote.php. This is the latest log entry:

{
   "reqId": "ZgYr2hecFMsra8k46RMoCgAAAQw",
   "level": 3,
   "time": "2024-03-28T21:47:54-05:00",
   "remoteAddr": "<REDACTED>",
   "user": "--",
   "app": "webdav",
   "method": "HEAD",
   "url": "/remote.php/dav/files/patti/InstantUpload/Screenshots/2024/03/",
   "message": "Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword()",
   "userAgent": "Mozilla/5.0 (Android) Nextcloud-android/3.28.0",
   "version": "28.0.4.1",
   "exception": {
      "Exception": "Error",
      "Message": "Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword()",
      "Code": 0,
      "Trace": [
         {
            "file": "/nextcloud/www/lib/private/User/Session.php",
            "line": 627,
            "function": "checkPasswordNoLogging",
            "class": "OC\\User\\Manager",
            "type": "->",
            "args": [
               "*** sensitive parameters replaced ***"
            ]
         },
         {
            "file": "/nextcloud/www/lib/private/User/Session.php",
            "line": 356,
            "function": "loginWithPassword",
            "class": "OC\\User\\Session",
            "type": "->",
            "args": [
               "*** sensitive parameters replaced ***"
            ]
         },
         {
            "file": "/nextcloud/www/lib/private/User/Session.php",
            "line": 453,
            "function": "login",
            "class": "OC\\User\\Session",
            "type": "->",
            "args": [
               "*** sensitive parameters replaced ***"
            ]
         },
         {
            "file": "/nextcloud/www/apps/dav/lib/Connector/Sabre/Auth.php",
            "line": 113,
            "function": "logClientIn",
            "class": "OC\\User\\Session",
            "type": "->",
            "args": [
               "*** sensitive parameters replaced ***"
            ]
         },
         {
            "file": "/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php",
            "line": 103,
            "function": "validateUserPass",
            "class": "OCA\\DAV\\Connector\\Sabre\\Auth",
            "type": "->",
            "args": [
               "*** sensitive parameters replaced ***"
            ]
         },
         {
            "file": "/nextcloud/www/apps/dav/lib/Connector/Sabre/Auth.php",
            "line": 231,
            "function": "check",
            "class": "Sabre\\DAV\\Auth\\Backend\\AbstractBasic",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/apps/dav/lib/Connector/Sabre/Auth.php",
            "line": 138,
            "function": "auth",
            "class": "OCA\\DAV\\Connector\\Sabre\\Auth",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
            "line": 179,
            "function": "check",
            "class": "OCA\\DAV\\Connector\\Sabre\\Auth",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
            "line": 135,
            "function": "check",
            "class": "Sabre\\DAV\\Auth\\Plugin",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
            "line": 89,
            "function": "beforeMethod",
            "class": "Sabre\\DAV\\Auth\\Plugin",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 456,
            "function": "emit",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 253,
            "function": "invokeMethod",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 321,
            "function": "start",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/apps/dav/lib/Server.php",
            "line": 373,
            "function": "exec",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/apps/dav/appinfo/v2/remote.php",
            "line": 35,
            "function": "exec",
            "class": "OCA\\DAV\\Server",
            "type": "->"
         },
         {
            "file": "/nextcloud/www/remote.php",
            "line": 172,
            "args": [
               "/nextcloud/www/apps/dav/appinfo/v2/remote.php"
            ],
            "function": "require_once"
         }
      ],
      "File": "/nextcloud/www/lib/private/User/Manager.php",
      "Line": 265,
      "message": "Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword()",
      "exception": {},
      "CustomMessage": "Call to undefined method OCA\\User_SAML\\UserBackend::checkPassword()"
   }
}
le-zell commented 8 months ago

Same issue here.

NextCloud client is not connecting anymore...

This method has been removed in 6.1.2 version of app user_saml

    public function checkPassword($uid, $password) {
        $qb = $this->db->getQueryBuilder();
        $qb->select('token')
            ->from('user_saml_auth_token')
            ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid)))
            ->setMaxResults(1000);
        $result = $qb->execute();
        $data = $result->fetchAll();
        $result->closeCursor();

        foreach ($data as $passwords) {
            if (password_verify($password, $passwords['token'])) {
                return $uid;
            }
        }

        return false;
solracsf commented 8 months ago

@blizzz https://github.com/nextcloud/user_saml/pull/808 need to be reverted it seems.

blizzz commented 8 months ago

Fix candidate in https://github.com/nextcloud/user_saml/pull/829

smotschnig commented 8 months ago

Fix candidate in #829

Thank you, that worked for me.