Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1511
  • Last Modified:

Getting the current users login name in IIS7

I have a web project which has been running on an IIS6 server for some time with no issues but i now need to migrate it over to IIS7 and i am having an issue which i cant seem to figure out.

The project uses active directory to authenticate users and to do this it gets the currently logged in user with 'LoginUser = new ProjectIdentity(Request.LogonUserIdentity.Name);'. This has been working fine on IIS6 but as soon as i have moved over to IIS7 the 'Request.LogonUserIdentity.Name' is only returning 'NT AUTHORITY\IUSR' every single time, whereas on IIS6 it would return DOMAIN\USER as expected.

Can anyone shed any light on the issue?
0
sypher1987
Asked:
sypher1987
1 Solution
 
somnaticCommented:
Probably you need to allow Windows Authentication in the IIS settings (not only basic auth).
0
 
random_ruCommented:
Are you using the ASP.NET login control or a custom build one?
 - If it is a ASP.NET control, use the control's property (username or password), for instance in C#:
         string username = LoginControlID.username;
 - If it is a custom built login, simply reference the username box, for instance;
        string username = txtUsernameID.Text;
0
 
jessc7Commented:
IIS 7.0: Configure Windows Authentication
http://technet.microsoft.com/en-us/library/cc754628.aspx
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now