nextcloud / user_external

đŸ‘„ External user authentication methods like IMAP, SMB and FTP
https://apps.nextcloud.com/apps/user_external
109 stars 65 forks source link

Add possibility to use "forgotten password" #60

Closed Mannshoch closed 5 years ago

Mannshoch commented 5 years ago

Please allow to set up a forgotten password link to config.php to be able to let user reset their own password by the login-backend provider. eg.

# Enter a Link to replace Password forgotten with. 
# ( {MAIL_USERNAME} get replaced by the text field value)
'user_backend_forgotten' => 'https://example.com/forgottenpage/forgottenscript.php?username={MAIL_USERNAME}&email={MAIL_USERNAME}'
violoncelloCH commented 5 years ago

indeed, that's a nice idea should be doable PR is welcome!

Drumsk8 commented 5 years ago

+1 on this, most certainly for IMAP connector. Only wish I had the time to assist on a PR.

If IMAP server is on cPanel/WHM the following API could be used: https://documentation.cpanel.net/display/DD/UAPI+Functions+-+Email%3A%3Apasswd_pop

Nutomic commented 5 years ago

This is already possible by setting lost_password_link in the Nextcloud config, unless I am missing something.

Documentation is here, Ctrl+F for lost_password_link:

https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=lost_password_link#user-experience

Mannshoch commented 5 years ago

Thats nice! Could I somehow add the Username/Mail address into the Link? e.g.: 'lost_password_link' => 'https://example.org/link/to/password/reset/ ?UID=$Mailadress&mail=$Mailadress&Username=$UserName', That's an important part because without at least the mail address as value it's again more easy that I handle it manually as current.

The user_backends app (which needs to be enabled first) allows you to configure alternate authentication backends. Supported backends are: IMAP (OC_User_IMAP), SMB (OC_User_SMB), and FTP (OC_User_FTP).

'lost_password_link' => 'https://example.org/link/to/password/reset',

If your user backend does not allow password resets (e.g. when it’s a read-only user backend like LDAP), you can specify a custom link, where the user is redirected to, when clicking the “reset password” link after a failed login-attempt.

In case you do not want to provide any link, replace the url with ‘disabled’

Nutomic commented 5 years ago

I dont see that mentioned in the documentation, so probably not. But I also dont see how it could work, because anyway the user has to enter their email or name somewhere. As this is a feature in Nextcloud itself, you should probably open an issue there.

violoncelloCH commented 5 years ago

@Nutomic thanks for pointing out! so this would first need adaptions in nextcloud's core... But I doubt that there is something that could be done in user_external at all, because all the resetting stuff is handled by nextcloud itself... so I think we can close this, can't we?

Nutomic commented 5 years ago

@violoncelloCH Yeah, the way I understand it, this has absolutely nothing to do with the user_external plugin. And OP already opened an issue in the Nextcloud repo for this.

Nutomic commented 5 years ago

Interesting, I can close issues here, just because I got a very minor PR merged into Nextcloud. Just wanted to try that, feel free to reopen if you disagree.

Mannshoch commented 5 years ago

I do not know if Nextcloud use 👍 to decide if they work on an Issue. But if that's the case, I ask you to Up-vote it. âžĄïž https://github.com/nextcloud/server/issues/15445

violoncelloCH commented 5 years ago

@Nutomic that's because you're a member of the Nextcloud Github organisation :) @Mannshoch I don't know either, but it gives it definitely more weight the more :+1: it gets...

Nutomic commented 5 years ago

@violoncelloCH yeah, but i'm surprised this gives me permission to close any issue in Nextcloud repos :D

violoncelloCH commented 5 years ago

community members are trusted :) if someone would do something abusive, this could be detected rather fast and the user banned I guess...