Solved

EnablePasswordRetrieval Custom MembershipProvider

Posted on 2007-11-16
2
961 Views
Last Modified: 2012-06-27
I have created a custom membership provider. I have EnablePasswordRetrieval set to true in my config. In my custom provider, I have code to retrieve the password.

But now I am using the PasswordRecovery control and I'm not sure what I need to do with it to get it to mail the password to the user.

Is my code supposed to handle the mailing of the password? What happens when they click the button to submit the form?

Also, can that form be altered to enter the email address instead of the user name and look it up by that?

thanks!
0
Comment
Question by:Starr Duskk
2 Comments
 
LVL 16

Accepted Solution

by:
McExp earned 450 total points
ID: 20302046
The following MSDN pages should give you what you need: -

http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.passwordrecovery.aspx

http://msdn2.microsoft.com/en-us/library/ms178341(vs.80).aspx

I'm not sure if you can use the email instead using the stock component, however if you've already the functions to retreive the password, it's not that hard to impliment this from scratch.

Getting a user from the Membership provider, is as follows:-

 MembershipUser UserToRemind = Membership.FindUsersByEmail("email@toMatch.com");
0
 
LVL 27

Assisted Solution

by:Sammy
Sammy earned 50 total points
ID: 20302066
Yes  your code should handle sending the email with the password to the user, after all its your custom provider.
thats being said, the password can not be hashed. simply hashed password will be useless to send to the user since it's not readable
if you inherited from native membership providers, you can use GetPassword to retrieve the password
more on the membership providers here http://msdn2.microsoft.com/en-us/library/f1kyba5e(vs.80).aspx

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.NET MVC identity 6 37
edit .asp files 5 42
Please explain purpose of GZIP 4 55
ASP.net Moving Visual Studio 2015 project to 2017 2 30
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question