Package org.adempiere.base
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 TypeMethodDescriptionvoidcompleteReset(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.voidrequestReset(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
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 identifierAD_Client_ID- tenant context used to resolve configuration (may be 0)language- AD_Language used for the email template (may be null)
-
verifyCode
Verify a code previously sent to the email. On success mints and stores a high-entropy verified token and returns its plaintext value. Throws anAdempiereExceptioncarrying the appropriate message on invalid/expired code or when attempts are exceeded.- Parameters:
email- the email address / login identifiercode- the code entered by the user- Returns:
- the plaintext verified token to pass to
completeReset(String, String)
-
completeReset
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 standardMUsersave path.- Parameters:
verifiedToken- the plaintext token returned byverifyCode(String, String)newPassword- the new password chosen by the user
-