Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 1st, 2006, 06:32 PM
Registered User
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Login logic problem

I've noticed a problem with the login logic in the beerhouse example. Forgive me if this has already been covered, but I couldn't find it in this forum anywhere. Here's the problem:

If I come in unauthenticated and try to go to the admin page, I get the AccessDenied.aspx page with ReturnUrl="[path]/Admin/Default.aspx" (or whatever the encoded version of that is).

Ok, so far so good here. However, if I then try to log in with the wrong credentials, I am again returned to the AccessDenied.aspx page, only this time ReturnUrl="[path]/AccessDenied.aspx?ReturnUrl=[path]/Admin/Default.aspx". So, the problem now is that if I go ahead and enter the right credentials, I get returned to the AccessDenied page again, but now I'm authenticated, so it just tells me that I'm not authorized for the page.

I think the solution to this is to change the FailureAction attribute of the Login control to "Refresh" since you want it to stay on the same page and not redirect to AccessDenied since you may already be there. However, doing this will mean you'll never see the AccessDenied page for an invalid login, which means you'll need to use the Access Denied message built into the login control itself. Either that or figure out some way to switch the FailureAction from Refresh to RedirectToLoginPage if you're not on the AccessDenied page already.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping through a list using logic tags problem aadz5 Struts 3 September 23rd, 2011 03:18 AM
Problems with login logic and Dashboard alanphil BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 18 August 13th, 2009 05:04 AM
problem while using <logic:iterate> tag be_sandip BOOK: Professional Jakarta Struts 0 November 13th, 2006 08:05 AM
Problem with loop logic holdmykidney XSLT 5 July 16th, 2004 07:11 AM
Mixing Data access logic and business logic polrtex BOOK: Professional Jakarta Struts 0 December 15th, 2003 07:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.