Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Jin Botol 134 posts 287 karma points
    May 25, 2018 @ 01:47
    Jin Botol

    Reset Password with UmbracoIdentity Package


    I'm trying to implement the Reset Password functionality using UmbracoIdentity.

    I got an error in: enter image description here

    I know that this is one of the Limitation of UmbracoIdentity, but I really need this function.

    Here is my code:

       public ActionResult ForgotPassword(ResetPasswordViewModel model)
           //generate alpha-numeric string
           var newPassword = MembershipHelpers.GetUniqueKey(10);
           var resetmember = UserManager.FindByEmail(model.ResetEmail);
           if (resetmember != null)
               var userId = UserManager.FindByEmail(model.ResetEmail).Id;
               UserManager.AddPassword(userId, newPassword);
               //Send email to the user
               var userEmail = new UserEmail()
                   EmailTo = resetmember.Email,
                   Message = $"You have requested a new password. Your new password is <b>{newPassword}</b>. You will be asked to change your password when you next log in.",
               EmailHelpers.SendEmail(userEmail, "Reset", "Your new password");
               return Json(new { status = "true", message = "Check your email..."});
               return Json(new { status = "false");



  • Robin Hansen 127 posts 299 karma points
    Dec 10, 2020 @ 14:11
    Robin Hansen

    Hi Jin, I'm facing the exact issue with my Umbraco 8 Solution. Did You manage to solve this - if so, would You care to share...?

    Regards Robin :)

  • Huw Reddick 832 posts 2820 karma points
    Dec 10, 2020 @ 14:58
    Huw Reddick

    If this is for frontend members, I use the MemberService to perform the actual change of the password.

    var memberService = Services.MemberService;
    var member = memberService.GetByEmail(form["email"]);
    memberService.SavePassword(member, form["NewPassword"]);
    member.LastPasswordChangeDate = DateTime.UtcNow;

    don't know if that is of any help.

Please Sign in or register to post replies

Write your reply to: