I have this application where I login by the PC user. I'm using this:
public static bool IsAuthenticated()
{
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
CurrentUser = Factory.Users.List(item => item.Username.ToLower() == cToLower()).FirstOrDefault();
}
return CurrentUser != null;
}
Note: .List(), is a method I created to list all database Users (in this case).
Everything works fine. But when I publish my Website on my IIS, HttpContext.Current.User.Identity.Name
is returning nothing, no user at all. What is wrong with it? Any suggestion?