Mixing Forms authentication with Windows authentication

Actually, you can do it. Bit late for @dr_draik, but this cropped up in a google result for me so I thought I’d share some knowledge.

If you’re in classic mode – Enable both Windows and Forms auth. You’ll get a warning about not being able to do both at once, but you can ignore it. Then, you can spelunk around various properties like
Code:

HttpContext.Current.Request.ServerVariables["LOGON_USER"]

and fish the username out of there.

If you’re in integrated mode – 4021905 IIS7 Challenge-based and login redirect-based authentication cannot be used simultaneiously leads to IIS 7.0 Two-Level Authentication with Forms Authentication and Windows Authentication which is a module that allows you to selectively change the auth for different pages.

Leave a Comment