FINERACT-2003: Enforce password reset on first login#5387
FINERACT-2003: Enforce password reset on first login#5387DeathGun44 wants to merge 1 commit intoapache:developfrom
Conversation
...ovider/src/main/resources/db/changelog/tenant/parts/0208_add_force_password_reset_config.xml
Outdated
Show resolved
Hide resolved
|
@IOhacker I looked into the failed tests ,failures are in LoanDelayedScheduleCaptures and LoanMerchantIssuedRefund but these appear to be unrelated to the Authentication changes in this PR. could you please re-run them? |
2d8b6b9 to
cabcc33
Compare
|
@adamsaghy Happy to take reviews, if any |
...apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java
Outdated
Show resolved
Hide resolved
...ovider/src/main/resources/db/changelog/tenant/parts/0208_add_force_password_reset_config.xml
Outdated
Show resolved
Hide resolved
...ovider/src/main/resources/db/changelog/tenant/parts/0208_add_force_password_reset_config.xml
Outdated
Show resolved
Hide resolved
adamsaghy
left a comment
There was a problem hiding this comment.
Please make sure this is optional, not enforced by default and properly tested.
cabcc33 to
a0eb7f7
Compare
Understood. I will update the logic to be optional and remove the redundant Liquibase scripts. And a new integration test (PasswordResetIntegrationTest.java) to this PR to verify the enforcement and optionality as requested. |
dbbda62 to
587c60a
Compare
592ce22 to
a2e7e56
Compare
f51b03f to
74baa59
Compare
|
@adamsaghy Ready for re-review whenever you have a moment! |
74baa59 to
eeb25b8
Compare
|
@DeathGun44 please rebase |
ae4306f to
97ffa3a
Compare
|
@adamsaghy Done! |
adamsaghy
left a comment
There was a problem hiding this comment.
I don’t believe this PR adequately addresses the requirements.
Any user with permission to change their password can simply override the existing one.
We need a system where the authenticated user is responsible for changing their own password!
97ffa3a to
e01ec8b
Compare
|
@adamsaghy Hi Adam, thanks for the feedback. I've reworked the implementation to strictly enforce self-service as requested: Dedicated Endpoint: The exemption now targets POST /users/{id}/pwd (ChangePassword) instead of the general updateUser. This limits changes to password fields only. Identity Check: I added a check to ensure entityId == currentUser.getId(). The exemption now only applies if the user is changing their own password. Verified Flow: POST /users/{ownId}/pwd → Allowed (Self-check passes, account unlocked). POST /users/{otherId}/pwd → Blocked (Self-check fails). PUT /users/{ownId} (General update) → Blocked (Wrong endpoint). Note: Admins can still reset passwords via the standard flow, which re-triggers the passwordResetRequired flag for the target user. |
a704f91 to
70fab71
Compare
c77586b to
b2c1471
Compare
b2c1471 to
4ba2f40
Compare
Description
Implemented FINERACT-2003: Enforce password reset on first login.
This PR adds a configurable, optional policy forcing users to change their password upon first login or after an admin reset.
Key Changes
password_reset_requiredcolumn tom_appuser.force-password-reset-on-first-loginglobal flag (disabled by default).Checklist