Interface IPasswordResetService

All Known Implementing Classes:
DefaultPasswordResetService

public interface IPasswordResetService
UI-agnostic password reset service (code-based flow).

Shared by the ZK WebUI and any other front-end (e.g. a REST plugin). The flow has three steps: request a code (emailed), verify the code (returns a short-lived verified token), and complete the reset (set the new password using the verified token). All password writes go through the standard MUser path (hashing + AD_Password_History).

Obtain the registered implementation via Core.getPasswordResetService().

Author:
d-ruiz - IDEMPIERE-7060
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    completeReset(String verifiedToken, String newPassword)
    Complete the reset: validate the verified token and set the new password for every active user sharing the identifier (all tenants), then invalidate their existing sessions.
    void
    requestReset(String email, int AD_Client_ID, String language)
    Request a password reset for the given email.
    verifyCode(String email, String code)
    Verify a code previously sent to the email.
  • Method Details

    • requestReset

      void requestReset(String email, int AD_Client_ID, String language)
      Request a password reset for the given email. Generates a numeric code, persists it hashed with an expiry, and emails it to the address. Behaves neutrally (no account enumeration): a non-matching email produces no observable difference. May throw when the per-identifier request rate limits are exceeded.
      Parameters:
      email - the email address / login identifier
      AD_Client_ID - tenant context used to resolve configuration (may be 0)
      language - AD_Language used for the email template (may be null)
    • verifyCode

      String verifyCode(String email, String code)
      Verify a code previously sent to the email. On success mints and stores a high-entropy verified token and returns its plaintext value. Throws an AdempiereException carrying the appropriate message on invalid/expired code or when attempts are exceeded.
      Parameters:
      email - the email address / login identifier
      code - the code entered by the user
      Returns:
      the plaintext verified token to pass to completeReset(String, String)
    • completeReset

      void completeReset(String verifiedToken, String newPassword)
      Complete the reset: validate the verified token and set the new password for every active user sharing the identifier (all tenants), then invalidate their existing sessions. Password policy is enforced by the standard MUser save path.
      Parameters:
      verifiedToken - the plaintext token returned by verifyCode(String, String)
      newPassword - the new password chosen by the user