Password management
User stories
- Any user can reset password using username or email without logging in.
- | | email is currently not unique in UIB? |
- Admin can reset password for another user. The uid is known.
- User can update password when logged in. The uid is known.
- Application can update password. The uid is known.
Responsibility
- UIB
- CRUD on user
- update password
- reset password using ChangePasswordToken
-
Disable user
-
UAS
- Send email, sms
Implementation notes
- Any user can reset password using username or email without logging in.
- Authenticated application, no authenticated user.
- POST /{applicationtokenid}/reset_password/{uidOrUsernameOrEmail}
- Set temp password and generate ChangePasswordToken, return time limited change password uri
- UAS or other clients can choose to forward this URI to user on email.
- Admin can reset password for another user. The uid is known.
- Authenticated application, authenticated application superuser.
- POST /{applicationtokenid}/reset_password/{uidOrUsernameOrEmail} (same as the regular reset password)
- User can update password when logged in. The uid is known.
- Authenticated application, authenticated user, update self.
- PUT /{applicationtokenid}/{userTokenId}/user/{uid} (userTokenId for user)
- | | The only application authorized to perform this action is SSOLoginWebApp. All other applications must only be allowed to initiate Password Reset. |
- Application can update password. The uid is known.
- Authenticated application, authenticated application superuser, update another.
- PUT /{applicationtokenid}/{userTokenId}/user/{uid} (userTokenId for admin)
- | | Only UserAdminWebApp must be allowed to perform real password change. All other applications must only be allowed to initiate Password Reset (see above) |
UIB
- POST /{applicationtokenid}/password/{username}/reset
- POST /{applicationtokenid}/password/{username}/change/{changePasswordToken}
- ~~POST /{applicationtokenid}/reset_password/{uidOrUsernameOrEmail}~~
- ~~PUT /{applicationtokenid}/{userTokenId}/user/{uid}~~
UAS
- Call resetpassword in UIB, send email to user
Concrete changes
- UIB
- PasswordResource - cleanup paths and methods
-
Remove email sending
-
UAS
- Expose UIB endpoints
-
Expose new endpoint which sends email on password reset
-
SSO Login Webapp
- Perform Password change for loged-in user.
- Perform Password change when user has received password reset link. This link is distributed via email.
Old Implementation notes
UAS
- POST /{applicationtokenid}/resetpassword/{usernameOrEmail}
- SetTempPassword: PUT /{applicationtokenid}/{userTokenId}/user/{uid}
- sendResetPasswordEmail with url with special ChangePasswordToken.
- The GUI exposed for changing the password is in SSOLoginWebapp, PasswordChangeController.
- PUT /{applicationtokenid}/{userTokenId}/user/{uid} (userTokenId for user)
- PUT /{applicationtokenid}/{userTokenId}/user/{uid} (userTokenId for admin)
UIB
- Password can be updated
- Use the regular PUT endpoint to update UserIdentity?
- PUT /{applicationtokenid}/{userTokenId}/user/{uid}