You can implement your custom method to verify the PAN card number and invoke MembershipUser.ChangePassword() method to change the password. Something
like below
public void customMethod(string pan)
{
string tempPass;
//Query the DB and get the username by PAN
var user = Membership.GetUser(userName);
tempPass = user.ResetPassword();
user.ChangePassword(tempPass, "newPassword");
}
The code you've given is for checking the PAN card detail in addition to security answer. But While putting PasswordRecovery, We need to have QuestionTemplate which verfies the Security Answer by default.(Which is mandatory). I need to have that event as
optional in the way that,
If you implement the QuestionTemplate, you can't make that optional. Then you may have to use your custom control instead of the PasswordRecovery
tool.
DiwakarG
Member
2 Points
4 Posts
Recover Password without Security Answer
Jun 24, 2012 06:41 AM|LINK
Hi
I have been given a requirement such as,
User should be able to enter his PAN card Number Or Security Answer which he entered during registration for Password recovery..
By default, PasswordRecovery template uses Security Answer to reset a password. Is it possible to change that as i said above??
Ruchira
All-Star
42975 Points
7025 Posts
MVP
Re: Recover Password without Security Answer
Jun 24, 2012 04:03 PM|LINK
Hello,
You can implement your custom method to verify the PAN card number and invoke MembershipUser.ChangePassword() method to change the password. Something like below
public void customMethod(string pan) { string tempPass; //Query the DB and get the username by PAN var user = Membership.GetUser(userName); tempPass = user.ResetPassword(); user.ChangePassword(tempPass, "newPassword"); }
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.DiwakarG
Member
2 Points
4 Posts
Re: Recover Password without Security Answer
Jun 25, 2012 05:26 AM|LINK
Hi
Hope you didnt get my question.
The code you've given is for checking the PAN card detail in addition to security answer. But While putting PasswordRecovery, We need to have QuestionTemplate which verfies the Security Answer by default.(Which is mandatory). I need to have that event as optional in the way that,
If(PanCard is correct)
//Send a password recovery mail
else if(security answer is correct)
//send recovery mail
Hope now clear?
Ruchira
All-Star
42975 Points
7025 Posts
MVP
Re: Recover Password without Security Answer
Jun 25, 2012 08:10 AM|LINK
Hi,
If you implement the QuestionTemplate, you can't make that optional. Then you may have to use your custom control instead of the PasswordRecovery tool.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.niceastham
Member
645 Points
175 Posts
Re: Recover Password without Security Answer
Jun 28, 2012 07:11 AM|LINK
As best practice and for security reasons, you passwords should not be recoverable. They should be one way hashed!
Then you can use the security questions to verfiy the user is correct before allowing them to reset the password or reset it using the system.
Saravananvam
Member
2 Points
7 Posts
Re: Recover Password without Security Answer
Aug 15, 2012 02:11 PM|LINK
Anyone have solution for this issues?