Nextcloud Client asks for login over and over (windows 10)

Since several months (I think I remember that some new login mechanism was introduced) I have the problem that the nextcloud clients on all machines that use it with my nextcloud keep asking for login credentials regularly after start.
The issue is hard to catch - sometimes it doesn’t bother the users for several weeks, sometimes it’s almost daily that it asks for login.

What could this be?

Nextcloud-Client is installed via chocolatey, Nextcloud is deployed via the official nextcloud docker image (not modified).

Thanks for any help.

1 Like

Ideally you have app passwords for your desktop client. Check on the security section of the settings-page, what app passwords were generated. You usually see when a login was used for the last time. Next time it asks for a password, create a new password, then enter your normal username and this newly generated app password.

Just had the same case again and tried what you suggest. Unfortunately it just doesn’t work at all with a generated app password.

Here what happens:

Nextcloud client icon is grey in the task bar, no sync running anymore.

I open nextcloud client and choose “login”:

Now this browser window pops up:

Klicking on “Anmelden” leads me to the default login page:

Now when I enter the previously generated app password for my username it tells me that username or password is wrong:
2020-03-19 21_46_40-Nextcloud

Using my default password works. Nextcloud client starts syncing.

For some while. Usually some days or 1-2 weeks later, the same procedure starts with being nextcloud client grey in the task bar.

For me it’s okay as I understand it but the users of my nextcloud installation is mainly my family, not IT skilled :wink: Some of them even never remember their password as I had to create some cryptical for them (otherwise they use things like “password1” :roll_eyes:).

Hey

i have the same issue, didn’t find a solution yet. i have it with a clean vm build ubuntu.

That sounds strange. When you use usual password, it seems to work properly. I have read about such problems on linux. There is one issue in combination with ldap (https://github.com/nextcloud/desktop/issues/1722). Is this just one client or others as well? Do you see if there are still the app passwords in the browser (it shows you when it was used for the last time).

I had an idea today (not confirmed yet).
Maybe it’s related to regular firefox updates? Does the nextcloud client somehow use some component of the system’s default browser?

I have a script running, updating Firefox to the most recent version on every startup of my laptop (via chocolatey). The same script is running on all machines of my nextcloud users (as I am the admin :wink: ).
Looking to that login page it refers to the full user agent string. Maybe this is also used somewhere in the login token or s.th.

I disabled this automatic Firefox update in my script now and will double check the behaviour during a manual Firefox update.

I have similar issues from time to time…
My setup is: three NC instances; all VMs (VMware and QNAP); at least two years each.
All constantly updated. Accessed by browser only - Safari/Edge/Chrome.
Many different computers, Windows and macOS…

I have the suspicion that NC will ask you for a password as many times as the number of open connections your username has.
So, if you logged in from 2 PCs with your credentials and didn’t log off, you’ll need to enter your password 3 times when attempting to connect from a third computer/browser…

Like it is severing the two old connections (in reality it does not).

I think only the first time to create the app password.

Did you check on your setting if the app password for the client still exists and isn’t deleted/lost? Would be great to know if it is a client or server side issue.

I didn’t create the app password. It’s the default password of the given user. But this shouldn’t make a difference in my opinion.

AS I said I disabled Firefox updates but the problem remains so my expectation is probably wrong (as you also suspected). I would also like to know where the problem is sitting.

Looking to the nextcloud logs I see plenty of “Login failed” messages, unfortunately without further explanation what failed. I increased the loglevel now to debug (0), hoping that maybe something helpful may be logged.

So today I had some minutes. The issue arised again.
Btw. it happened suddenly during runtime, so when I started up the laptop, nextcloud client initially synchronized but then - within the next about 30-40 minutes the icon turned grey again.

As I said I turned Debug Logs on and I found some debug infos regarding a missing Bearer header. Maybe this is a trace?
Looking to the timestamp it could fit, but looking at the user agent I assume more that it might be the firefox browser that was opened to re-gain access…
Is it possible to find the sync-client via it’s user agent? How would the user-agent be named?

{
  "reqId": "BtJiiAAamHObcF0odao1",
  "level": 0,
  "time": "2020-05-03T11:21:13+00:00",
  "remoteAddr": "XXX",
  "user": "--",
  "app": "webdav",
  "method": "PROPFIND",
  "url": "/remote.php/dav/files/peez/",
  "message": {
    "Exception": "Sabre\\DAV\\Exception\\NotAuthenticated",
    "Message": "No public access to this resource., Username or password was incorrect, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect",
    "Code": 0,
    "Trace": [
      {
        "function": "beforeMethod",
        "class": "Sabre\\DAV\\Auth\\Plugin",
        "type": "->",
        "args": [
          {
            "absoluteUrl": "http://nextcloud.XXX.de/remote.php/dav/files/peez/",
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php",
        "line": 105,
        "function": "call_user_func_array",
        "args": [
          [
            {
              "autoRequireLogin": true,
              "__class__": "Sabre\\DAV\\Auth\\Plugin"
            },
            "beforeMethod"
          ],
          [
            {
              "absoluteUrl": "http://nextcloud.XXX.de/remote.php/dav/files/peez/",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 466,
        "function": "emit",
        "class": "Sabre\\Event\\EventEmitter",
        "type": "->",
        "args": [
          "beforeMethod",
          [
            {
              "absoluteUrl": "http://nextcloud.XXX.de/remote.php/dav/files/peez/",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 254,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "absoluteUrl": "http://nextcloud.XXX.de/remote.php/dav/files/peez/",
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Server.php",
        "line": 319,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/remote.php",
        "line": 165,
        "args": [
          "/var/www/html/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
    "Line": 168,
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)",
  "version": "18.0.4.2"
}

Hello Everyone,
same issue here with every startup of my desktop (Windows + Firefox).

Thanks.

Did anyone file cause of this. I have 4 Users that have to re-setup app password every week.
I think it is an issue on their PC as I can login with the same account to another PC and never get asked.
Also I have 2 Nextcloud servers and it is doing it to both.
Thanks,

Same problem here. Sinca a week or so, no way I tried helped. I can´t get the Desktop Client to “know” that it is authorized. The client wants me log in in the browser, no matter what I do. Aftet the login, I can tell my NC (two Clouds with two different Accounts, btw), that the authorization is ok, it wont work.
I can login first, then try to authorize the client, it opens a new browser window and want me to log in agoain, then authorize. But it wont “remember” this too.

I can not get my client to connect to my two clouds.

Hi,
Same issue here. The user is under Firefox.
Even by using an other computer, the problem reappeared after some months (only for that user over 50)
Best Regards

Hi,
I changed the default browser to Chrome. The agent still disconnects.