Reputation: 71
I am implementing "Forgot Password" functionality in asp.net mvc 2.0 site.Scenario is ,If i click Forgot Password button it will go to some page and it asks the user to enter his email id.Once he entered his email-id ,then his password is retrieved from the database and send to his email id . How to send password to user email.If you have any similar posts please send me the link.
Upvotes: 0
Views: 2100
Reputation: 48958
I know it happens in a lot of apps, but realy, and excuse me for the bold caps for once, : YOU MUSTN'T STORE USERPASSWORDS!!
In stead you should store one-way hashes like MD5 or SHA1, or anything really, and compare the hashed value of their input with the value in the database. That way, if your data is hacked, your users are still safe.
A lot of users use the same pwd for everything, so if you have their email AND pwd, you, an employer or a hacker, has access to their mail and God knows what else... It is just not ethical for a good programmer to keep passwords.
So the answer : reset their password, mail it to them, and make them change it at first login.
Upvotes: 1