You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
occ user:add-app-password should also work without the users login password #26563
The occ command user:add-app-password should work without the users login password.
If a admin needs to create a app password for a user for whatever reasons (e.g. in migration szenarios) it is quite unlikely that they know the login password from the users. The provisioning API and the graphical user management allow the admin to change the users password without knowing the old one. Why should the user:add-app-password be more strict?
Second, in case of SSO no user has a login password on Nextcloud. All passwords are handled by the IDP. The current behavior of the occ command makes it completely useless in any SSO environment.
Therefore I would suggest to remove the password input/check or at least make it optional.
changed the title [-]occ user:add-app-password should also work without the users login password[/-][+]`occ user:add-app-password` should also work without the users login password[/+]on Apr 19, 2021
The password is there because we validate it if the backend supports it. So it is validated on actual use.
That's the thing: we don't.
Steps to reproduce
Have a local user Alice with password Bob123
Test the password with a PROPFIND Dav API call authenticating with -u Alice:Bob123 --> works
Test a wrong password with a PROPFIND Dav API call authenticating with -u Alice:Bob1234 --> [...] Username or password was incorrect [...] --> works as intended
Run occ user:add-app-password Alice
Prompt asks for password: Type asdfasdfasdf --> output=token
Run Call from 2. but replace Bob123 with token from 5.
Expected behavior
Token gets rejected
Actual behavior
Token gets accepted as app password --> no validation of the entered password happening
So the generated token works although the provided password was wrong? If yes, we should probably drop all password related parts of the code. If the generated token doesn't work, we should probably validate the password correctly, no?
This issue has been automatically locked because it has been closed for more than 14 days. As we do not monitor closed issues, we are locking this issue to prevent further comments from getting lost in the noise.
Please open a new issue if you have a similar problem instead. For general discussions, please use our forum: https://help.nextcloud.com
Activity
wiswedel commentedon Apr 15, 2021
Regardless of what you enter as a password, it's not validated anyway. The generated app password works - even if the password is wrong.
ref: https://github.com/nextcloud/server/blob/master/core/Command/User/AddAppPassword.php#L118
So the password check can as well be dropped.
[-]occ user:add-app-password should also work without the users login password[/-][+]`occ user:add-app-password` should also work without the users login password[/+]rullzer commentedon Apr 21, 2021
The password is there because we validate it if the backend supports it. So it is validated on actual use.
Same for SMB etc.
But sure feel free to shoot in a PR to make it optional.
wiswedel commentedon Apr 21, 2021
That's the thing: we don't.
Steps to reproduce
occ user:add-app-password Aliceasdfasdfasdf--> output=tokenExpected behavior
Actual behavior
szaimen commentedon Jul 2, 2021
So the generated token works although the provided password was wrong? If yes, we should probably drop all password related parts of the code. If the generated token doesn't work, we should probably validate the password correctly, no?
yoyoyonas commentedon Aug 6, 2021
That's correct. Tested on NC 21.0.3.
pr0kium commentedon Dec 16, 2025
in 32, that's not true anymore.
github-actions commentedon Nov 16, 2026
This issue has been automatically locked because it has been closed for more than 14 days. As we do not monitor closed issues, we are locking this issue to prevent further comments from getting lost in the noise.
Please open a new issue if you have a similar problem instead. For general discussions, please use our forum: https://help.nextcloud.com