ASP.NET Get Windows Domain User ID in IE when using Forms authentication
In asp net 4.0, I cannot get windows username on form's authentication.
Here is the code:
//get windows user name without domain name
string windowsUserName = WindowsIdentity.GetCurrent().Name.Split('\\');
It is correct in debug mode but get the application name after publishing to IIS.
Here is the web.config:
<forms loginUrl="~/Account/Login.aspx" protection="All" defaultUrl="Default.aspx" timeout="30" />
This web application access is based on a security table permission rather than windows authentication. How to get the user's window ID when user is browsing the app.