reset password in sitefinity 5.1

Posted by Community Admin on 04-Aug-2018 15:21

reset password in sitefinity 5.1

All Replies

Posted by Community Admin on 15-Feb-2013 00:00

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>


Posted by Community Admin on 18-Feb-2013 00:00

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

Posted by Community Admin on 19-Feb-2013 00:00

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

Posted by Community Admin on 20-Feb-2013 00:00

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

This thread is closed