I have a intranet website where I am able to get the user's identity value when run in Local machine.
System.Web.HttpContext.Current.User.Identity.Name.ToString().Substring(3)
But When I deploy the same on IIS 8.5, It finds it blank.
Please help me understand where I am going wrong ?
For impersonation we have to use the specific username and password.
Web.config:
<system.web>
<authentication mode="Windows" />
<customErrors mode="RemoteOnly" defaultRedirect="~/Pages/Error/Error.aspx" >
<error statusCode="404" redirect="~/Pages/Error/404.aspx" />
</customErrors>
<identity impersonate="true" userName="user1" password="pass1" />
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
IIS settings:
Windows authentication - Enabled
Impersonation - Enabled
Rest all disabled.
Default app pool - Integrated mode.