Copied to clipboard

Flag this post as spam?

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


  • Bex 444 posts 555 karma points
    Sep 23, 2010 @ 12:15
    Bex
    0

    'Password reset is not supported' Why? Work Around?

    Hi!

    I have a forgotten password page, where I just take the username of the user and do the following:

     MembershipUser user = Membership.GetUser(userName);
     string newPassword = user.ResetPassword();

    I am relatively new to umbraco and assumed as you could use the standard membership provider functions to login  and get users, everything else would also be available but I get the following error:

    Password reset is not supported

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NotSupportedException: Password reset is not supported

    All I want is a new password generated, that I can email to the user, I give then a link in the email to go to a page to change the password! From previous experience I know .net generates horrible passwords, so I don't want to use the standard "forgotten password" control (that's even if that's supported?) as this will just email the user a new password and my website doesn't have a "Change password" page by default. There is a reason for this, so don't tell me to create one!

    My passwords are hashed so I can't just got user.password = as this doesnt work! What's the work around?

     

    Thanks

    Bex

  • Sascha Wolter 615 posts 1101 karma points
    Sep 23, 2010 @ 12:29
    Sascha Wolter
    0

    Hi Bex,

    I have been creating the new password with help of the MembershipProvider:

    Member emailLostMember = Member.GetMemberFromEmail(email);
    string password = Membership.GeneratePassword(10, 2);
    MemberShipHelper mh = new MemberShipHelper();
    emailLostMember.ChangePassword(mh.EncodePassword(password, MembershipPasswordFormat.Hashed));

    Hope that helps,

    Sascha

  • Bex 444 posts 555 karma points
    Sep 23, 2010 @ 13:29
    Bex
    0

    Ahh.. thanks for the reply sascha.. but it was my bad (due to misleading error message) the problem was with the webconfig setting enablePasswordReset being set to false.. it is supported!!

  • Sascha Wolter 615 posts 1101 karma points
    Sep 23, 2010 @ 13:49
    Sascha Wolter
    0

    Great, good to know! :)

Please Sign in or register to post replies

Write your reply to:

Draft