Return 401 Error Code To Browser With Forms Authentication

G

Guest

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
(e-mail address removed)
 
B

Brock Allen

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."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top