0

In my SharePoint 2010 FBA, i have configured to use the asnetsqlmembershipprovider and created a separate UI for user management,which does the add/edit/ forgotpassword etc. In the case of changing the password and apply a new password for employees of the company, its failed to do so.

below is my code fromw ebconfig:

<membership defaultProvider="OPMembership">
  <providers>
    <add name="OPMembership" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="OPAPP" connectionStringName="FBACON" enablePasswordReset="true" **enablePasswordRetrieval="false"** passwordFormat="Hashed" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" />
  </providers>
</membership>
<roleManager enabled="true" defaultProvider="OPRoles">
  <providers>
    <add name="OPRoles" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="OPAPP" connectionStringName="FBACON" />
  </providers>
</roleManager>

it says opasswordretrieval=false . Does that mean, i wont be able to give a mechanism to update the endusers of my custom fba web appln?

should i go with some other approach for passwordretrieval and update the password.?

1

With enablePasswordRetrieval = false you can still change the password. Simply call the ResetPassword method to get a new password for the account. You can then use the newly reset password to change the password on the account to any password you want. Take a look at the ResetUserPassword code of the SharePoint FBA Pack, it does exactly that:

http://sharepoint2010fba.codeplex.com/SourceControl/latest#Visigo.Sharepoint.FormsBasedAuthentication/Visigo.Sharepoint.FormsBasedAuthentication/Code/Utils.cs

  • Thanks for the reply and link. Is there any way, i can change the password of the existing user , using sql or t-sql approach? because that would be easier, instead of writing c# code . – userAZLogicApps Sep 25 '16 at 15:40
  • 1
    Check the stored procedures in the membership database (aspnetdb) - there are stored procedures for each of the operations you can call through the API. So yes, I think you should be able to call the stored procedures directly to do the update, but I haven't done so myself, so i'm not sure if there are issues with this. – Chris Coulson Sep 25 '16 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.