Forms Authentication Redirect To Error Page
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting Asp.Net forms authentication to use 403 custom error page instead of login page up vote 1 down vote favorite I've a got an Asp.Net site that is using Forms authentication, I've also got custom errors configured in the web.config. One of these is a special error page for 403's (access denied). My question is how do I get Forms authentication to work smarter? I would like Forms authentication to send users to login page only if they are not authenticated. If they are I want it to defer to the custom error pages that i've defined in the web.config. This seems like something very basic, how can this be achieved?
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/General ASP.NET/Security/Forms Authentication and Custom Error Pages Forms Authentication and Custom Error Pages RSS 3 replies Last post May 04, 2005 11:50 AM by pacman182 ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Related Links GuidanceSamples Reply ghostrider None 0 Points 2 Posts Forms Authentication and Custom Error Pages May 03, 2005 01:01 PM|ghostrider|LINK I have http://stackoverflow.com/questions/4229328/getting-asp-net-forms-authentication-to-use-403-custom-error-page-instead-of-log Forms Authentication setup on my app and also a custom error page. However, I'm finding that whenever an exception occurs, users are redirected back to my login page with a return URL to my error page. Once they log in again, they are now presented with the error page. I'm not sure what I'm doing wrong. http://forums.asp.net/t/882409.aspx?Forms+Authentication+and+Custom+Error+Pages Here is the snippit from my web.config. Any help is greatly appreciated. Thanks!
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top IIS 7.5: How to configure custom Authentication Error page with Windows Authentication. 401 header problems up vote 12 down vote favorite 4 I have a php website running under IIS 7.5. The site is secured by Windows authentication and that works fine: When users go to the site, they are asked for username/password and get through if authenticated. If users click Cancel or mistype password 3 times, they are shown 401 error page: Now I would like to show custom page explaining how to log-in. So I go to Error pages, select status code 401.2 and point it to the page I would like to display: Then make sure the custom errors are turned on for everybody. And kaa-boom! Authentication does not work any more, users are not presented with the password prompt. As documentation says, Windows Authentication works by sending 401 reply first, then browser asks user to provider credentials and then they work out what to do next. What happens here: on first request for the page IIS tries to send 401-header, but notices that web.config says "on 401 redirect to this page". And instead of authentication, it just gives the redirect page. I've tried replacing 401, 401.1, 401.2 - made no difference. What am I doing