Solved

Getting the current users login name in IIS7

Posted on 2009-05-18
3
1,472 Views
Last Modified: 2012-05-07
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
Comment
Question by:sypher1987
3 Comments
 
LVL 4

Accepted Solution

by:
somnatic earned 50 total points
ID: 24413839
Probably you need to allow Windows Authentication in the IIS settings (not only basic auth).
0
 
LVL 5

Expert Comment

by:random_ru
ID: 24414478
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
 
LVL 16

Expert Comment

by:jessc7
ID: 24414481
IIS 7.0: Configure Windows Authentication
http://technet.microsoft.com/en-us/library/cc754628.aspx
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

23 Experts available now in Live!

Get 1:1 Help Now