Return 401 Error Code To Browser With Forms Authentication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ryan Rife

    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
    rrife@tridentre source.com

  • Brock Allen

    #2
    Re: Return 401 Error Code To Browser With Forms Authentication

    The FormsAuthentica tion 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.IsAuthe nticated == 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



    [color=blue]
    > 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
    > rrife@tridentre source.com[/color]



    Comment

    Working...