ASP.Net Forms Authentication - Windows Identity Question - Guru needed

Posted on 2012-09-13
Last Modified: 2012-09-25
Hello all,

I have an issue I was hoping not to run into but did.  So on my localhost I have an app that uses forms auth and I can't change it.   That is all set in the solution root web.config.  There is a subdirectory root that has its own web.config shown below.  On my local in debug I can get the user logged on name fine with:

Request.ServerVariables["LOGON_USER"] also tried the Security Principal identity still both are empty on prod server with IIS7.

But when I installed on IIS7 it also has anonymous enabled as well as basic and window auth.  I tried disabling anonymous access but got "Internet Explorer cannot display webpage".   I know I can't mix auth mode either in a subdirectory or that errors.  I really don't want to have to seperate out this stuff as it will be difficult but I have to get the windows auth name.  It works fine on my localhost running through VS though of course.

In my root config I tried impersonate=true as well.

This is in my subfolder where I am trying to get the logged on user.  The main root has the forms auth set in the web config auth settings.
<?xml version="1.0"?>
 Allow all users in this subfolder.
      <allow users="*" />

Open in new window

Question by:sbornstein2
    LVL 96

    Expert Comment

    by:Bob Learned
    I don't understand your question...are you asking how to get the identity for Forms Authentication user?
    LVL 26

    Accepted Solution

    Fairly sure Windows authentication was/is only intended for intranet, but apparently Mixed Mode Authentication is an option.

    If you are hosting your own web site on your own server, it may be possible to expose a portion of your intranet as a hosted site by adding a virtual directory to your default site.

    This <allow users="*" /> will allow anybody to the view the contents of the folder and won't invoke any authentication procedures. Think it should be <allow users="?" /> for authentication procedures to kick in.

    LVL 23

    Expert Comment

    by:Roopesh Reddy

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now