p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950
This is the forum to discuss the Wrox book ASP.NET MVC Website Programming Problem Design Solution by Nicholas Berardi, Al Katawazi, and Marco Bellinaso; ISBN: 9780470410950

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 5th, 2009, 10:19 AM
Authorized User
Points: 57, Level: 1
Points: 57, Level: 1 Points: 57, Level: 1 Points: 57, Level: 1
Activity: 28%
Activity: 28% Activity: 28% Activity: 28%
 
Join Date: Sep 2009
Posts: 13
Thanks: 3
Thanked 0 Times in 0 Posts
Default The forgot password doesn't work

On p. 122. ForgotPassword action resets the password independently from the answer.

It seems likely, that Memebership.Provider.ResetPassword(username, secretAnswer) doesn't take into account the secret answer at all!

Does anybody else experienced this error, and can propose a solution.

What if the user forgot the username and password?

It would be better to get the e-mail address from the user instead of user name.

Thanks

Gabriel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 7th, 2009, 11:06 AM
Authorized User
Points: 57, Level: 1
Points: 57, Level: 1 Points: 57, Level: 1 Points: 57, Level: 1
Activity: 28%
Activity: 28% Activity: 28% Activity: 28%
 
Join Date: Sep 2009
Posts: 13
Thanks: 3
Thanked 0 Times in 0 Posts
Default Nobody on theis issue?

Answer to my own question

The forgot password to work:

1. In the web.config file we would set the RequireQuestionAndAnswer=true

2. In the ForgotPassword action method we have to insert a Try/Catch:

if (!String.IsNullOrEmpty(secretAnswer))
{

try
{
string resetPassword = Membership.Provider.ResetPassword(userName, secretAnswer);
if (Membership.ValidateUser(userName, resetPassword))
{
FormsAuthentication.SetAuthCookie(userName, false);
return RedirectToAction("ChangePassword", new { resetPassword = resetPassword });
}
else
{
TempData["ErrorMessage"] = "Invalid Response";
return View();
}
}
catch (Exception ex)
{
TempData["ErrorMessage"] = ex.Message;
}
}

Last edited by Gabor66 : November 7th, 2009 at 03:35 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 7 Email setting for "forgot password?" hdpark BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 10 April 23rd, 2008 03:48 PM
forgot sa password, unable to change... help happygv SQL Server 2000 13 May 28th, 2007 03:49 AM
FORGOT EXCEL PASSWORD prasanta2expert Excel VBA 3 November 16th, 2006 08:26 PM
Forgot password for phpmyadmin AMP_Engineer BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 September 8th, 2004 05:59 AM
Forgot password? developerz BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 30th, 2003 04:36 PM



All times are GMT -4. The time now is 04:49 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc