Package org.adempiere.base
Class DefaultPasswordResetService
java.lang.Object
org.adempiere.base.DefaultPasswordResetService
- All Implemented Interfaces:
IPasswordResetService
Default
IPasswordResetService implementation (code-based reset).- Author:
- d-ruiz - IDEMPIERE-7060
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
DefaultPasswordResetService
public DefaultPasswordResetService()
-
-
Method Details
-
requestReset
Description copied from interface:IPasswordResetServiceRequest 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.- Specified by:
requestResetin interfaceIPasswordResetService- 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
Description copied from interface:IPasswordResetServiceVerify 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.- Specified by:
verifyCodein interfaceIPasswordResetService- Parameters:
email- the email address / login identifiercode- the code entered by the user- Returns:
- the plaintext verified token to pass to
IPasswordResetService.completeReset(String, String)
-
completeReset
Description copied from interface:IPasswordResetServiceComplete 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.- Specified by:
completeResetin interfaceIPasswordResetService- Parameters:
verifiedToken- the plaintext token returned byIPasswordResetService.verifyCode(String, String)newPassword- the new password chosen by the user
-