Sunday, July 2, 2017

Reset Password using AccountManagementService API in AEM 6.2 - Part2


Hello Everyone

In our previous User Creation using AccountManagementService API blog we have learned how to create the aem user account? Here, we will discuss about resetting the password.

To achieve the same we have to use requestPasswordReset() method of AccountManagementService API.

Explanation of requestPasswordReset() method of
AccountManagementService  API

method api.PNG
Fig- requestPasswordReset() Method
Below are the parameters of requestPasswordReset() method in detail:

  • userId: UserId, for which you are changing the password.
  • requestUrl: From this parameter, API will get the host and port. This host and port used to create confirmation page url, which is send to user in mail for request for password. Example: http://localhost:4502
  • configPath: It is a path of the node(e.g., “/content/resetPasswordProperties”) type of nt:unstructured, where only one property is needed.

a) confirmationPage: This confirmationPage link will be sent in password reset request mail, On click which, user will be redirected to the page having reset password form.
Note: This field is mandatory.


properties.PNG
Fig- config path node with its properties




Functionality of requestPasswordReset() method


Change password.jpg
Fig- Functionality of requestPasswordReset() method

Steps to follow:
  • User have to fill the Reset Password Form and submit the request.
reset password.PNG
Fig - Reset Password Form

  • This Request received by the servlet  and the servlet calls the requestPasswordReset() method of AccountManagementService API.
  • After submission of the form, "Request to change password" mail will be sent to user.
mail Password.PNG
Fig - Email for send the request to change password
    • User have to click “request to change password” link from email, and  it will redirect user to change password form.
    change.PNG
    Fig - Change Password Form
      • This "change password" form is nothing but a “newPassword” component which is having newPassword.html and POST.html .
      newPassword.html

      Note: The above html contain a hidden field having value of “ky” token.

      Post.html

      Note: Above post.html will execute on newPassword form submission as it is defined in the action of form,which includes the requestconfirmation.jsp. requestconfirmation.jsp will help to reset the password.
      • After submitting the Change Password form, A post request goes to the server. and Post.html will execute to change the password
      • After that user will get confirmation email for password change .
      password-changed.PNG
      Fig- Email for Password changed

      Let's demonstarte User Creation and Reset Password Using "AccountManagementSetvice API" here:


      If you have any query or suggestion then kindly comment or mail us at sgaem.blog02@gmail.com

      Hope it will help you guys !!
      Thanks and Happy Learning .

      8 comments:

      1. "Nice and good article.. it is very useful for me to learn and understand easily.. thanks for sharing your valuable information and time.. please keep updating.php jobs in hyderabad.
        "

        ReplyDelete
      2. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java EE Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

        ReplyDelete
      3. I tried that but it is get the error message on the accountManagementService API. which is get the null exception so it is not get the mail and not able to reset the password.

        ReplyDelete
      4. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. Digitogy

        ReplyDelete
      5. You need to download this program on a computer you do have access to and then load it onto a CD.reset windows 10 password

        ReplyDelete
      6. Amazing post! I appreciate your hard work. Thank you for sharing. I have also share some use full information.
        Drone pro review
        mosquitron reviews
        eco beat earphones review
        Coolair review
        Coolair air cooler review

        ReplyDelete