I need to retrieve the current logged on User ID in the IIS then I will pass that ID to a function for authentication purpose.
public ActionResult Login(myLoginModel model)
{
System.Security.Principal.IPrincipal user;
user = System.Web.HttpContext.Current.User;
String name = user.Identity.Name.ToString();
AuthenticateUser(name)
}
I always got a null value for "name". My web.config file is:
<authentication mode="Windows"/>
<identity impersonate="true"/>
and I have disabled Anonymous Authentication and enabled Windows Authentication on the IIS Manager. Can you help me fix this problem?