The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Mixing Forms and Windows Authentication

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Darrell Norton

Posts: 876
Nickname: dnorton
Registered: Mar, 2004

Darrell Norton is a consultant for CapTech Ventures.
Mixing Forms and Windows Authentication Posted: Jul 26, 2004 9:09 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Darrell Norton.
Original Post: Mixing Forms and Windows Authentication
Feed Title: Darrell Norton's Blog
Feed URL: /error.htm?aspxerrorpath=/blogs/darrell.norton/Rss.aspx
Feed Description: Agile Software Development: Scrum, XP, et al with .NET
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Darrell Norton
Latest Posts From Darrell Norton's Blog

Advertisement

Craig Andera, over on PluralSight blogs (it has a main feed now!), has a post showing how he integrated Windows and Forms Authentication for the same web application. From his post:

“The trick was realizing that if you enable both “anonymous” and “integrated” authentication for a particular virtual directory, the browser won't try to authenticate to the web server until it receives a 401 (Unauthorized) back from the web server. But you can issue your own 401 any time you like!”

Well, the trick is not that you don’t get authenticated until a HTTP 401 error occurs, that’s standard IIS security. The trick is how he issues a 401 to force the authentication:

     if (user.Length == 0) // They haven't provided credentials yet
    

       Response.StatusCode = 401;
       Response.StatusDescription = "Unauthorized";
       Response.End(); 
     }

Check out the full code sample on Craig’s blog post on mixing forms and windows authentication.


This Blog Hosted On: http://www.DotNetJunkies.com/

Read: Mixing Forms and Windows Authentication

Topic: Lookout Download Pulled? Previous Topic   Next Topic Topic: Answer: What is the lifetime of local instances?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use