1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / reset password in sitefinity 5.1

reset password in sitefinity 5.1

4 posts, 0 answered
  1. developer
    developer avatar
    13 posts
    Registered:
    11 Feb 2013
    15 Feb 2013
    Link to this post

    I want to reset user password. I click 'reset password' button from Edit user panel, but doesn't send e-mail. How to see user password and reset it?

    Second question; When I resetpassword, I take following error : 'Password reset is not enabled. Set the EnablePasswordReset property of the membership provider to true' Can somebody help me?

    My code:

       public static string GetCurrentUserPassword(string userName)
        {
            MembershipProvider p = (MembershipProvider)Membership.Providers["Default"];     
            MembershipUser obj = Membership.GetUser(userName);
            return obj.ResetPassword();               
        }  

    web config :

      <siteMap defaultProvider="SitefinitySiteMap">
                <providers>
                    <add name="SitefinitySiteMap" type="Telerik.Sitefinity.Web.SitefinitySiteMap, Telerik.Sitefinity" enablePasswordReset="true" requiresQuestionAndAnswer="false"  taxonomyProvider="OpenAccessDataProvider" pageTaxonomy="Pages" rootNode="FrontendSiteMap" pageProvider="OpenAccessDataProvider"/>
                </providers>
            </siteMap>
            <roleManager enabled="false"/>
            <membership defaultProvider="Default">
                <providers>
                    <clear/>
                    <add name="Default" type="Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider, Telerik.Sitefinity"  enablePasswordReset="true" requiresQuestionAndAnswer="false"/>
                </providers>
            </membership>


  2. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    18 Feb 2013
    Link to this post
    Hi Abderus,

     Thanks for using Sitefinity.

    To enable this feature you need to visit Administration > Settings > Advanced > Membership providers > Default > Parameters > enablePasswordReset. By default you will see that it's set to "false". Set the value to "true" and restart your application pool. You also need to set the recoveryEmailAddress in the same location. Here's a full article on how to set this up. For information on setting up SMTP to send the email read through this documentation article.

    I hope this helps.

    Kind regards,
    Patrick Dunn
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. developer
    developer avatar
    13 posts
    Registered:
    11 Feb 2013
    19 Feb 2013 in reply to Patrick Dunn
    Link to this post

    Hi UnmarkPatrick,

    Thanks for knowledge.

    I did all settings and 'reset passwords' button works. Also I've a method like this : 

    public static string ResetPassword(string userName)
     {
            MembershipProvider p = (MembershipProvider)Membership.Providers["Default"];      
            return p.ResetPassword(userName, "");
     }

    It returns to new password then I mail it to user with my custom e-mail function. Any else, with new password, I can not login system. It doesn't accepted. But If I resetted password in sitefinity cms system, I can login.

    Why 'ResetPassword' did not work correctly?

    Thanks in advance

  4. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    20 Feb 2013
    Link to this post
    Hi Abderus,

     It's likely you have set requiresQuestionAndAnswer="true" and passwordFormat="true" for the membership provider. With these set you must supply them during a password reset. You can of course remove these settings or use another method to change the password.

    <system.web>
     ...
     <membership defaultProvider="Sitefinity" ...
       ...
       <add name="Sitefinity" connectionStringName="DefaultConnection" type="Telerik.DataAccess.AspnetProviders.TelerikMembershipProvider, Telerik.DataAccess" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"/>

    For users comming from ASP.NET mebership there is additional setting.

    Regards,
    Patrick Dunn
    the Telerik team
4 posts, 0 answered