Avatar of Barnum
BarnumFlag for United States of America

asked on 

Get Windows login in ASP.NET website on IIS 7

In my asp.net 4.0 website I am using windows login  user name to login in my website without asking credential if that windows login user is  in DB if that user not in db then asking credential and authenticate against db .
To achieve above goal I implemented form and widows authentication in my website.
When I ran website through VS 2010(Dev. environment) I get actual windows login name but if I ran website on IIS 7 then I get “IUSER” as a windows login.
Following command I am trying  
      
"HttpContext.Current.Request.LogonUserIdentity.Name" get "IUSR" (NT AUTHORITY\IUSR) on IIS 7.
      
"HttpContext.Current.User.Identity.Name"  get  empty on IIS 7.
      
How can i get actual windows login on IIS 7 as well?
ASP.NETMicrosoft IIS Web Server

Avatar of undefined
Last Comment
Barnum
Avatar of Member_6283346
Member_6283346

Hi! You need to enable impersonation in web.config:
<configuration>
  <system.web>
    <identity impersonate="true"/>
  </system.web>
</configuration>

(http://msdn.microsoft.com/en-us/library/xh507fc5.aspx)
Avatar of Barnum
Barnum
Flag of United States of America image

ASKER

i am already using this.
ASKER CERTIFIED SOLUTION
Avatar of Dustin Hopkins
Dustin Hopkins
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Barnum
Barnum
Flag of United States of America image

ASKER

Yes, I already did this.
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Barnum
Barnum
Flag of United States of America image

ASKER

I tried above solution.
Still not working for me.
Avatar of Barnum
Barnum
Flag of United States of America image

ASKER

We settled on a different method of authentication.  Thanks for all the the help, though!
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo