Skip to content

occ user:add-app-password should also work without the users login password #26563

Closed

Description

@schiessle

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.

Activity

  1. wiswedel commented on Apr 15, 2021

    @wiswedel
    Contributor

    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.

  2. 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
  3. rullzer commented on Apr 21, 2021

    @rullzer
    Member

    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.

  4. wiswedel commented on Apr 21, 2021

    @wiswedel
    Contributor

    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

    1. Have a local user Alice with password Bob123
    2. Test the password with a PROPFIND Dav API call authenticating with -u Alice:Bob123 --> works
    3. Test a wrong password with a PROPFIND Dav API call authenticating with -u Alice:Bob1234 --> [...] Username or password was incorrect [...] --> works as intended
    4. Run occ user:add-app-password Alice
    5. Prompt asks for password: Type asdfasdfasdf --> output=token
    6. 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
  5. szaimen commented on Jul 2, 2021

    @szaimen
    Contributor

    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?

  6. ghost added
    staleTicket or PR with no recent activity
    on Aug 1, 2021
  7. yoyoyonas commented on Aug 6, 2021

    @yoyoyonas

    So the generated token works although the provided password was wrong?

    That's correct. Tested on NC 21.0.3.

  8. ghost removed
    staleTicket or PR with no recent activity
    on Aug 6, 2021
  9. added
    1. to developAccepted and waiting to be taken care of
    good first issueSmall tasks with clear documentation about how and in which place you need to fix things in.
    papercutAnnoying recurring UX issue with possibly simple fix.
    and removed
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Aug 8, 2021
  10. removed
    good first issueSmall tasks with clear documentation about how and in which place you need to fix things in.
    on Feb 14, 2022
  11. added and removed
    1. to developAccepted and waiting to be taken care of
    on Mar 23, 2022
  12. Repository owner moved this from 🏗️ In progress to ☑️ Done in 💌 📅 👥 Groupware teamon Apr 4, 2022
  13. pr0kium commented on Dec 16, 2025

    @pr0kium

    So the generated token works although the provided password was wrong?

    That's correct. Tested on NC 21.0.3.

    in 32, that's not true anymore.

  14. github-actions commented on Nov 16, 2026

    @github-actions
    Contributor

    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

  15. locked as resolved and limited conversation to collaborators on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions