Open k-jell opened 1 year ago
Hi @k-jell -
There is the sociallogin app enabled and set up for authentication using Oauth. But the issue also arises, when creating a user through the CLI which never logs in using a web client or Oauth or anything like that. [..] I am using the sociallogin plugin where I configured a custom provider to connect via Oauth. Not sure how this plays into the issue.
I'm not sure either. Any way you can test with socialogin
disabled? Also, does it make any difference if you log in as the target user via the web interface and create their app password there? Lastly, any chance you're also seeing Nextcloud log entries that say App token login name does not match
around the same time period?
P.S. Might be worth testing this to see if there's a change in behavior (if it's an option in your environment - there are caveats): https://github.com/nextcloud/server/issues/37637#issuecomment-1510979672
I'm not sure either. Any way you can test with socialogin disabled? Also, does it make any difference if you log in as the target user via the web interface and create their app password there? Lastly, any chance you're also seeing Nextcloud log entries that say App token login name does not match around the same time period?
After some further testing:
There are no App token login name does not match
messages in the log though.
⚠️ This issue respects the following points: ⚠️
Bug description
I'm trying to use app passwords to mount webDAV shares. To create the app passwords I use the occ command
php occ user:add-app-password --password-from-env someuser
. For mounting I use davfs2 (password set in the secrets file). After creating a fresh app password mounting the share does work for a while (some 5-15 minutes I would say, but it feels random). After that mounting fails bacause the Basic Auth is rejected, so the password apparently stops working:/sbin/mount.davfs: Mounting failed. Could not authenticate to server: rejected Basic challenge
In the nextcloud logs there is this:
[core] Warning: Login failed: 'loginbot' (Remote IP: '172.17.0.1')
There is the
sociallogin
app enabled and set up for authentication using Oauth. But the issue also arises, when creating a user through the CLI which never logs in using a web client or Oauth or anything like that.To debug it further I have set up a sql trigger, that throws an error, when the
password_invalid
field is set in theoc_authtkoen
table. In the stacktrace it looks like this password check fails, which causes the invalidation (but it's probably not the root of the bug since the password check fails for some other reason).: https://github.com/nextcloud/server/blob/f3bdcfd4272f6caeac1fc5d78aa93cdca2f5d519/lib/private/User/Session.php#L759-L764Maybe related: https://github.com/nextcloud/server/issues/37637 https://help.nextcloud.com/t/app-tokens-being-set-to-password-invalid-repeatedly/94557
Steps to reproduce
php occ user:add someuser
php occ user:add-app-password --password-from-env someuser
Expected behavior
Webdav share is successfully mounted every time.
Installation method
Community Docker image
Nextcloud Server version
27
Operating system
None
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
I am using the sociallogin plugin where I configured a custom provider to connect via Oauth. Not sure how this plays into the issue.