I am trying to figure out why HttpContext.User.Identity.Name
is returning blank.
Code
public ActionResult Test()
{
string username = HttpContext.User.Identity.Name;
return Content(username);
}
Am I using this in the wrong context? I am trying to get the user's username.
Web.Config
<authentication mode="Windows" />
IIS
I have enabled Anonymous and nothing else is checked. I am running IIS 6.0.
Is there any type of information I need to add to assist with figuring this out? I am pretty stuck. I checked this question but do I need to set a Cookie to make this work?