Skip to content

Conversation

@DeathGun44
Copy link
Contributor

Description

Implemented FINERACT-2003: Enforce password reset on first login.
This PR adds a configurable policy forcing users to change their password upon first login or after an admin reset.

Key Changes

  • Database: Added password_reset_required column to m_appuser. System user mifos is explicitly exempted.
  • Configuration: Added force-password-reset-on-first-login global flag.
  • Security: Implemented PlatformUserDetailsChecker to enforce the check post-authentication, replacing custom DaoAuthenticationProvider inheritance.
  • Logic:
    • Trigger: Flag set to true on User Creation and Admin Password Reset.
    • Clear: Flag set to false on successful Self Password Change.
    • Loop Prevention: Logic prevents reset loops during self-updates.
  • API: Throws PasswordResetRequiredException (HTTP 403) to signal the UI.

Checklist

Note:
I have temporarily included the fix from PR #5384 (GlobalConfigurationHelper.java) to unblock the integration tests (avoids IndexOutOfBoundsException). I will remove this file via rebase once PR #5384 is merged.

</addColumn>
</changeSet>

<changeSet author="fineract" id="2" context="postgresql">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a context for MariaDb?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Victor, thank you for the review!

I looked into this to be sure, and since the c_configuration table is defined with autoIncrement="true" in the initial schema, MariaDB and MySQL automatically handle the ID counter updates when we insert new rows.

The setval command included here is specifically to manually sync the PostgreSQL sequence, which doesn't update automatically in the same way. I believe we don't need an equivalent step for MariaDB, but please let me know if you'd prefer I handle it differently!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

Copy link
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DeathGun44
Copy link
Contributor Author

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants