?
Solved

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

Posted on 2012-09-13
4
Medium Priority
?
324 Views
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 asp.net 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.
-->
<configuration>
  <system.web>
    <authorization>
      <allow users="*" />
    </authorization>
  </system.web>
</configuration>

Open in new window

0
Comment
Question by:sbornstein2
4 Comments
 
LVL 96

Expert Comment

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

Accepted Solution

by:
Alan Warren earned 2000 total points
ID: 38400929
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.

Alan
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38402663
0
 

Author Closing Comment

by:sbornstein2
ID: 38432585
thanks
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 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