ASP.NET User User Forgot Password

Q: Is there a mechanism for mvc3 / asp.net membership / object where, if the user forgets his username, is there a way to reset it or find out what it is and programmatically send it back to the user or the link in which they re-register?

+4
source share
3 answers

If you use the ASP.NET MVC project membership provider, you can easily implement views / controllers / password recovery models. I have an example of this on my blog:

http://hectorcorrea.com/Blog/Password-Recovery-in-an-ASP.NET-MVC-Project

+3
source

Check out this site. It is very detailed and should help you on the right track. This is done programmatically.

http://www.asp.net/security/tutorials/recovering-and-changing-passwords-cs

If instead you want to do this with less code, you end up using the PasswordRecovery control, which is part of the membership system. You can find some details at http://msdn.microsoft.com/en-us/library/ms178335(v=vs.80).aspx

If you have a membership setting in normal mode, you can use the default control. Examples from the above link.

 <asp:PasswordRecovery ID="PasswordRecovery1" Runat="server"> </asp:PasswordRecovery> 

You may need to provide anonymous access to a form that has this control. Do this in the web.config file.

 <configuration> <location path="RecoverPassword.aspx"> <system.web> <authorization> <allow users="?" /> </authorization> </system.web> </location> <system.web> <authentication mode="Forms" > <forms loginUrl="UserLogin.aspx" /> </authentication> <authorization> <deny users="?" /> </authorization> </system.web> </configuration> 

If you need help in the right place, just ask.

+2
source

All Articles