-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Logintoken are Invalidated 21.0.1 #26502
Comments
Same problem as already described by newhinton. Actual behaviourWeb browser login
Third Party Apps
This error exists even for older tokens which were created with an older Nextcloud version. Nextcloud Desktop-Client (Version 3.1.3) You can go through the hole process over and over again with always the same results. Server configurationOperating system: Web server: Database: PHP version: Nextcloud version: Updated from an older Nextcloud/ownCloud or fresh install: Where did you install Nextcloud from: List of activated apps: Enabled:
Are you using encryption: no Nextcloud logThe log shows tons of such messages.
|
Just wanted to add that I noticed this happen only when upgrading from 21.0.0.18 to 21.0.1.1. I hope this narrows things somewhat. |
Do you have any workaround to get Android and Desktop client applications work until this is fixed ? |
I'm seeing the exact same behavior as userofgithub023897 on the latest Docker image, but only for LDAP-authenticated users. The LDAP setup has been working through many Nextcloud versions and all tests on the LDAP / AD Integration page are still successful. LDAP-authenticated users can log in (web and apps), but are thrown out after a couple of minutes. My recurring log entries read:
Hope it helps narrowing this down. |
im facing exactly the same behavior as @userofgithub023897 describes. (also with 21.0.1) |
I'm also seeing similar behaviour, but for me, it seems that logging into a new device which requires an app password will log me out of other devices. i.e. I use DAVx5 and the Nextcloud app on my phone, and if I log in to one, it logs me out of the other. This also seems to reflect on my Desktop client too, where logging in there will log me out of my phone. This doesn't appear to affect logging in via the web interface at all, as I can use that without it affecting whatever application is currently logged in. Edit I'll update this if any of my clients decide to stop working. |
@agentrigby How did you extract the apppassword from the desktopclient? |
It looks like the issue only occurs for users that have log in via web interface. Other users that haven´t logged in to Nextcloud via web browser since the update to 21.0.1 are still able to use their tokens on their devices and for their apps. At least there were no complaints about any login errors until now. The log only shows the error messages for users that have logged in via web interface: |
@newhinton Not sure if it's allowing 2 sessions on my install, or different ways of logging in are treated differently. I was able to login to the desktop client and use an app password for DAV without any issues, but the moment I logged in on the mobile app with my standard credentials, it broke both the desktop app and DAV. Just been doing a bit more testing, and it seems whenever I login with a third session, it kicks the oldest one out. i.e. If I login via the web browser, it breaks the oldest session (DAV), leaving the 2 newer sessions active. When I generate a new app password, it breaks my desktop app, but leaves my web session active, then when I sign in again with my desktop app, it logs me out of my web session. |
Here nearly the same. There seems to be a problem with users who use security keys for login. We have a lot of Yubico Fido2/Webauthn keys in use. ==> They are logged out of the system after a few minutes. (Warning | core | Login failed:...) The security keys are configured as Webauthn + U2F. Users with TOTP login as 2nd factor are not affected. This is a big problem for us as we have a number of users with Fido2 access. |
I have a smiliar issue. I started migrating my user from normal login + otp to keycloak based login via social login. I didn't realize that that users are getting logged out, but now that I've read this issue it's actually exactly like that. I do also use DAVx5 to synchronize my calendar and contacts, but whenever I use the webinterface I get logged out of DAVx5 and so on. |
I can see the same issue if I use FIDO2 for login, but there is another strange behavior. If I reconnect my desktop clients using the login flow with my password, everything is fine. If I login into the webinterface using my password, still, everything is fine. But after login with FIDO2, all clients including the web session itself is logged out after some time. |
For security reasons, we have coupled the login (username/password) with TOTP as a 2nd factor. These users have no problems logging in and staying logged in. Only very few in our education centre use the desktop client. For example, I had to log in again with the desktop client. This way everything works. All users with security keys can log in but are kicked out after a few minutes. It's a drama |
the problem in my case for example is, that i don't really "know" the password because its very long and random.. i mean its kept somewhere in an offline storage of course... but using username and password is not really a handy option.. and breaks my security concept... thats the whole point of the fido2 key.. |
As described by @flo90 and @osm-frasch the error might be related to FIDO2 login procedure. I logged in to web interface via TOTP instead of using the hardware token and created completely new tokens for my devices and apps. These newly created tokens work for hours now without any problems. Afterwards, I logged in to Nextcloud web interface using TOTP instead of FIDO2 to check if the tokens will be set automatically invalid which is not the case. Until now I haven´t any issues with this workaround. Everything works fine. So maybe the problem is not directly related to Nextcloud but only to the app "Two-Factor U2F". (https://apps.nextcloud.com/apps/twofactor_u2f) |
I am experiencing the same errors described by @newhinton without using TOTP or FIDO2 but OIDC and LDAP Backend. All my app passwords became invalid after the upgrade. Newly created app passwords cannot be used ("unauthorized error"). Using different sync clients at the same time all of them are disconnected after some minutes. @userofgithub023897 Maybe there is also an error in the app you mentioned but I don't think that the original issue is caused by this. |
The normal password works with clients aswell, using DavX5 with the default login-password allows the client to sync. This only works without 2FA. |
Either way,...is the solution already being taken care of? It is a big problem |
Regarding the Fido2 problem: I noticed that whenever I changed the chat room in the Talk app, I was immediately logged out. If I was not active in the other apps, e.g. file directory, I was logged out after about 2 minutes. We have activated U2f on our security keys (Yubico) in addition to webauthn/Fido2. As a temporary solution to the problem, it helps to delete the webauthn/Fido2 authentication in the security settings of the account and only use the U2f authentication on the stick. This then works perfectly...but does not solve the basic Fido2 problem. |
All my users are connecting to Nextcloud through SSO (Keycloak + pulsejet/nextcloud-oidc-login). Having them falling back to a dedicated nextcloud password is not an option unfortunately. They can still access to nextcloud web, but mobile/desktop apps are not usable anymore due to deconnection issues already described above. Is there a change in Nextcloud 21 API that should be reported to pulsejet/nextcloud-oidc-login or this is 100% a Nextcloud server bug please ? |
I use the exact same setup and NC 21.0.1 introduced this problem to my server as well |
I've got the same issue. I'm using Social Login App with OAuth2 connection to Mailcow. |
Workaround whilst this gets fixedExplanation: It seems that the commit linked below is the only change that was made to app passwords. I tracked this down from comparing the changes between 21.0.0 and 21.0.1. The lines below were removed, which seems to force app password renewals on each login. The workaround consists of simply reverting this change manually. Re-add the following lines after line 416: if (!$this->mapper->hasExpiredTokens($uid)) {
// Nothing to do here
return;
} in Whilst not the ideal way to solve this issue (since that commit was intended to fix a different issue), at least your Nextcloud's app passwords will stop getting revoked until either Nextcloud or the third-party Authentication plugins get updated with a fix. Make sure to restart all services/Docker containers which relate to Nextcloud after applying this workaround. I tested this on my Nextcloud 21.0.1.1 installation and it seems to be working correctly, as before upgrading to 21.0.1.1 which broke app passwords for me. I tested it by revoking my current app passwords, creating new ones, logging in using aforementioned app passwords, then logging out and logging back in several times through the Web GUI. After that I check whether the app passwords were invalidated or still working. In my case, after the fix, they are still working correctly. I use Source: 0ea266e#diff-e75921bd09f4308ffa271ad59d43378719bf6ce5108a730708e7557f87a1e84aL417 |
This is an issue with Social Login and Someone please try this and revert (note you need to use the nc19 branch for lower than Nextcloud 19). |
Thank you @pulsejet. I upgraded to pulsejet/nextcloud-oidc-login 2.0.1 (and removed the workaround above). I tested my Android Apps (Notes, Files and Davx5) and they work fine now. I only had to relogin with the "Nextcloud Files" application, not the others. I will do further testing with the desktop apps tonight and report issues if any. Thanks a lot for your quick upgrade. |
It seems the issue seems to be fixed with the appupdate. Thanks @pulsejet! |
I don't use the plugin from pulsejet and have the issue. So reopening would be nice. |
I am not sure, should a new bug report about the Fido2 thing be created at this point now. I was referred to this place in the Support Forum because there seemed to be a connection to this bug report. |
why is this issue closed? this isn't solved... we don't use the plugin and the error still exists... |
I can confirm. The problem still exists. I deactivated Social Login yesterday, as the system was not really usable anymore. |
The webauthn/Fido2 problem also still exists. I wonder. These problems are general and should be solved quickly. |
The original problem seems to be a change in the nextcloud-api, which broke apps using the old api. The pulsejet/nextcloud-oidc-login app fixed that, but the webauthn app does not seem to have recieved an update. This holds true for social login aswell, those issues need to be resolved in the respective apps and not the server. Please open issues in their repositories so that the maintainers can update their apps |
We do not use the stand-alone "Twofactor Webauthn app". |
Ah sorry, i was under a different impression. I think it would be advisable to create a new issue, specifically for Webauthn/Fido2, as not to confuse underlying issues. (Ah i see, you just did that) |
All those affected by the Fido2 issue should post their additional info in the new bug report (#26806) or give a thumbs up to draw attention to the problem. |
This may be an separate issue since I have found people having this issue since 2018. I am using an external LDAP that users password+otp. So the password / bind can only be used once to validate. However the user is getting logout after about 5 minutes with the following Bind failure. Can someone update the LDAP module to use the admin bind for secondary lockups and only use the user bind to validate the users credentials once? I am still using version 20.0.9 I am using default settings for these settings:
|
In my case, I've updated from 20.0.x to 21.0.5 and I've saw a big increase of the load on the database from this kind of request. I've injected the code as the fix suggest and I got back to normal load on the db. I don't use any third party apps, just app password and normal auth most of the time from webdav client. Perhaps, a lot of the sync connected are still on the 2.x.x version, so it may try to creates token at every poke on the server. Thanks for the temporary fix! |
I'm observing the same issue with Nextcloud 22.2.3, Ldap Backend 1.12.1, oidc_login 2.1.0 and Keycloak as IDP: I did not yet try the fix suggested by @DanWiseProgramming |
I have a bog standard Nextcloud 24.0.2 installation without any special plugins or auths running and implemented the suggested workaround from #26502 (comment) some hours ago (obviously at the correct position, the given line number is not valid anymore). As far as I can tell, it just works fine without creating a zillion authtokens anymore. Of course I cleaned the database table before testing. I'm not sure if re-adding this check in updatePasswords() has any negative side-effects, but at least it definitely solves the issue of duplicated authtokens. |
We are still running into this issue, even with latest 24.0.4. Produces HUGE amounts of garbage data if mysql binary logging is enabled (which is kinda mandatory if you like your data). This needs to be fixed properly once and for all. |
OMG, this was driving me crazy for months. Logging in from my computer was taking almost 2 minutes (!) and I was unable to log in the app on my iPhone at all. The workaround above fixes it all right up, the line number is, however, not correct any more. As mentioned, the file to edit is
A login now takes a couple of seconds. Result! |
Recently had this very same issue (ie. desktop client keeps signing out after ~2 hours and would need manual reauth). This occurred after U/G from 25.0.12 > 27.1.3 and PHP 7.4 > 8.2. Nobody seems to be able to give a real solution despite the numerous questions I read on the subject. I applied your workaround above @dominalien and this "works" for me. This issue shouldn't be closed really. |
In fact no, the following day, the problem is back... I shall open a new case that would hopefully get more attention. |
After updating to 21 from 20, external applications cannot access nextcloud anymore. Shortly after they were set up (Either via the Loginflow, or manually setting up tokens and inserting them in the respective app) they are getting disabled and the corresponding app is beeing logged out or recieves "Unauthorized" errors. The Logmessage is not providing a reason why a token was invalidated. The webui works as intended.
Edit: Forum
Steps to reproduce
Expected behaviour
Login should not be invalidated.
Actual behaviour
Token gets immediately invalidated.
Server configuration
Operating system:
Ubuntu 20.04
Web server:
Apache
Database:
Msql
PHP version:
7.4.3
Nextcloud version: (see Nextcloud admin page)
21.0.1.1
Updated from an older Nextcloud/ownCloud or fresh install:
Updated from 20.0.9
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using encryption: no
Are you using an external user-backend, if yes which one: Single Sign on via Keycloak
Client configuration
Nextcloud Apps (Linux Desktop and Android), DAVx5
Logs
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
The text was updated successfully, but these errors were encountered: