Problem/Motivation
This is a follow-up issue for #2968598: User with simplesaml_auth can't change password
Currently, if the user has just registered through SAML authentication they have to reset their password to be able to change their information as they didn't know their password.
This is really a very bad user experience and doesn't make sense at all.
Also what if the SAML authentication does not provide the email for the users, in this case how the users should reset their passwords?
Proposed resolution
I suggest following the one-time-login-link way when the user is logged in for the first time only. In this case, the user will be able to set a new password and edit their information for the first time only without entering the current password. Then if they forgot the password they can reset it in the usual way.
User interface changes
The current password field will be hidden when the user is logged in for the first time, and they should be redirected to the edit profile page instead of the view profile page if the setting (Allow SAML users to set Drupal passwords) is checked.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | users_dont_know_their_passwords-3112380-11.patch | 9.44 KB | anas_maw |
Comments
Comment #2
anas_maw commentedComment #3
pdenooijer commentedSeems like a good approach to me! The code implementation should be very strict though as this could have serious security implications if done wrong.
Comment #4
anas_maw commentedHello, this is an initial patch to start from, I think it still needs some minor tweaks.
This patch will allow users to set their password when the logged in for the first time only using the password reset mechanism.
Also, I added a new option (Force set Drupal password) which will force users to set the Drupal site password when they logged in for the first time.
Notes:
- Please apply this patch #3089049-2: Don't set the access time of newly registered users or use the development version of the external_auth module to get the expected results.
- When Drupal 8.9.0 is up we should change the way we use php $_SESSION, please check #2473875: Convert uses of $_SESSION to symfony session retrieved from the request
Comment #5
anas_maw commentedComment #6
anas_maw commentedComment #7
anas_maw commentedComment #8
anas_maw commentedRemove deprecated code from the patch
Please review
Comment #9
anas_maw commentedFixes...
Comment #10
anas_maw commentedFixes ....
Comment #11
anas_maw commentedMore fixes