473,396 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Return 401 Error Code To Browser With Forms Authentication

I'm trying to return a 401 statuscode to the client browser on my web site,
however whenever I do this I get a 302 statuscode redirecting me to my login
page. Any ideas on how to prevent the redirect?? Thanks

Ryan Rife
rr***@tridentresource.com

Nov 19 '05 #1
1 2404
The FormsAuthentication module check for a 401 and then does this redirect.
You'd need to look into building your own module that somehow cancels the
FormsAuth redirect. The other thing I do is on my login page I write some
extra code to see if Request.IsAuthenticated == true. If this is the case,
I throw up a message that says "You're already logged in, but you tried to
access a resource that you're not allowed to. Please provide credentials
that will allow you access to that page."

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm trying to return a 401 statuscode to the client browser on my web
site, however whenever I do this I get a 302 statuscode redirecting me
to my login page. Any ideas on how to prevent the redirect?? Thanks

Ryan Rife
rr***@tridentresource.com


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
7
by: Leon Shaw | last post by:
Someone please help me understand the following error message: Server Error in '/solo' Application. ---------------------------------------------------------------------------- ---- ...
4
by: Andrew Banks | last post by:
Can anyone help me out with why the following code in web.config <authentication mode="Forms" /> <forms loginUrl = "Secure/Login.aspx" /> </authentication> gives me the following error ...
2
by: Thomas Scheiderich | last post by:
I am trying to set up forms authentication in my IIS pages. I have a folder inside of my root folder I am trying to protect and I am getting an error when a page in the folder is accessed. The...
2
by: Sam | last post by:
Inquiry? -------- I would like to authenticate all subdirectory via asp.net at Windows Server 2003 and IIS 6.0 but it prompt an error message as shown as below: Runtime Error? --------------...
1
by: Joe | last post by:
What I want to do is make only one page require a login. The application itself works fine. I'm getting the following error: Parser Error Message: It is an error to use a section registered as...
2
by: Sumi | last post by:
Hi, I've the following code in my web.config - <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" timeout="30" name=".ASPXAUTH" requireSSL="false"
1
by: Jules | last post by:
For a project I'm developing a custom ASP.NET 2.0 website. The case: - Forms authentication - Cookieless forms authentication and sessionstates is enabled via cookieless="AutoDetect". - On the...
2
by: Zulander | last post by:
Hi, For some reason my session are expireing when the web browser closes and User.Identity.IsAuthenticated is truning true, I have a webcrontrol from login: Protected Sub Login1_LoggedIn(ByVal...
7
by: Adrian Parker | last post by:
We have an application that's running ok on most of our customers machines, but on one of them we get an error. They're running on windows 2003 server with iis6. In the web.config, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.