baiapooped
baiapooped

Reputation: 185

asp.net: how to get the server to recognize user's user ID

i was working on an xp machine and had installed IIS on the xp machine. without a problem i was getting the users identity like this:

 string username = HttpContext.Current.User.Identity.Name.ToString();

we just upgraded to windows 7 and are using IIS 7.

executing that same line in the compiler works fine; however, when i try to execute that line from IIS here is the username that is returned:

IIS APPPOOL\DefaultAppPool

how can i get it to return the actual user name of the person who is logged onto his computer and looking at this web application?

please keep in mind that it uses windows authentication and works only on our company network

Upvotes: 0

Views: 898

Answers (1)

Adam Tuliper
Adam Tuliper

Reputation: 30152

Are you sure the current user has authenticated? Is windows authentication actually working? This should be the current user's id if and only if they have authenticated.

Note some common issues here, specifically the order here with windows auth vs. anonymous

HttpContext.Current.User not populated with Windows Authentication enabled

Also what does HttpContext.User.Identity.Name return for you?

Upvotes: 1

Related Questions