Skip to content
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

Add occ command for checking the password for a given user ID. #44335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stellarpower
Copy link

Summary

Adds an occ command for checking the password for the given user ID. The user can provide the password literally in the CLI arguments (less secure but other applications don't prevent this), using OC_PASS, through stdin or interactively.

I have a small self-contained application that needs to authenticate users. Rather than maintain a separate set of credentials, or set up something like LDAP (would be overkill), adding a command like this seems the best way to achieve what I needed - the application is server-side and can then look up the user and password, and the exit status is used to determine if the user was authenticated or not.

Uploading so that the community can benefit from contributions, but please do feel free to pull into a feature branch and rework or modify heavily and use as a springboard. This solved a particular usecase I had so figured may be useful.

TODO

  • Tried to make the interactive prompt detect if it's in a TTY or a pipe, but this seems to return true in either case
  • People may want to modify this heavily or not add it for security implications for what code is in here. I've thought about some basics, but am not a security expert, nor do I know much about nextcloud's design. I started from the password reset command; so this seems comparable, but someone should review and consider the implications
  • I'm by no means a PHP developer, so there may be significant defects.
  • Don't have the ability to test against current master; slight modifications and it appears to work on my installed server, running NC 21, but would need to be tested properly against master code.

Checklist

@solracsf solracsf added this to the Nextcloud 29 milestone Mar 19, 2024
@solracsf solracsf added 3. to review Waiting for reviews feature: occ labels Mar 19, 2024
This was referenced Mar 20, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
This was referenced Apr 4, 2024
@blizzz blizzz modified the milestones: Nextcloud 29, Nextcloud 30 Apr 8, 2024
@skjnldsv skjnldsv added 2. developing Work in progress stale Ticket or PR with no recent activity and removed 3. to review Waiting for reviews labels Jul 27, 2024
This was referenced Jul 30, 2024
This was referenced Aug 5, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress feature: occ stale Ticket or PR with no recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants