SiteGenesis resets passwords using an email. On the My Account Login page, the customer clicks Forgot Password? A new window opens, asking for the customer's email address.
When the customer enters an email address and then clicks Send, Salesforce B2C Commerce:
When the customer receives the email and follows the link, the SiteGenesis Account pipeline is triggered, which calls the ValidateResetPasswordToken pipelet to find the customer associated with the token on the querystring. There are two cases:
When customer submits the form, the following occurs:
Security Considerations
Several customer-facing account management and authentication components request user email addresses and report to the customer whether or not these addresses are valid user names. An attacker could use one of these pages to enumerate valid user names, which in turn facilitates password brute-forcing or phishing attacks.
To address this concern in SiteGenesis, the Account-PasswordResetDialog shows the same message whether or not the email address exists in the customer records.
The following common message appears:
Thanks for submitting your email address. We’ve sent you an email with the information needed to reset your password. The email might take a couple of minutes to reach your account. Check your junk mail to ensure you receive it.
Update Password Page Where the Customer Must Enter Old and New Password
The SetCustomerPassword
pipelet optionally validates
the customer's existing password before setting a new password. You can
use this to implement an Update Password page where the user must enter
both the new and the existing password for security reasons. The
SetCustomerPassword
pipelet uses the parameter
VerifyOldPassword
.
The following SiteGenesis Core cartridge files provide this feature:
Use the Account.xml pipeline to implement forgot password.
Use these templates:
File | Description |
---|---|
account/login/logininclude.isml
|
Contains a link to the forgot your password window. |
account/password/requestpasswordreset_confirm.isml
|
Page that shows a confirmation when the password is successfully reset. |
account/password/requestpasswordreset.isml
|
Asks for an email address and sends an email when the user clicks Submit. |
account/password/requestpasswordresetdialog.isml
|
Asks for an email address and sends an email when the
user clicks Submit. Similar to
requestpasswordreset.isml, but renders as a
popup window instead of a top-level page. |
account/password/setnewpassword_confirm.isml
|
Shows a confirmation when the password is successfully reset. |
account/password/setnewpassword.isml
|
Page for entering a new password after following the link in the email. |
mail/passwordchangedemail.isml
|
Email that is sent when the customer successfully resets the password. |
mail/resetpasswordemail.isml
|
Email that is sent asking the customer to reset the password. |
Use this resource bundle
account.properties
: contains password-related
text strings.These pipelets perform the Forgot Password and general password functionality:
GenerateResetPasswordToken:
generates a random
token that can be used for resetting the password of the passed
customer.ResetCustomerPassword:
generates a random
password and assigns it to the supplied customer.ResetCustomerPasswordWithToken:
set the password
of the specified customer to the specified value.SetCustomerPassword:
assigns the specified
password to the specified customer profile.ValidateResetPasswordToken:
validates that the
passed token created by a previous call to GenerateResetPasswordToken
is valid.See the B2C Commerce API documentation.
See the SiteGenesis Wireframes for page layout details.