I'm implementing a ASP.NET MVC Project with Form authentication. This project is deployment and run OK, but now I need get the current windows user but I don't get it. I try this:
System.Security.Principal.WindowsIdentity.GetCurrent().Name:
but return NT AUTHORITY\NETWORK SERVICE or AUTHORITY\IUSR with this configuration in the IIS.
- Anonymous Authentication = Enabled.
- Impersonation = Disabled.
- Forms Authentication = Enabled.
- Windows Authentication = Disabled.
- Basic Authentication = Disabled.
When I Try:
Anonymous Authentication = Disabled.
Impersonation = Enabled.
Forms Authentication = Disabled.
Windows Authentication = Enabled.
Basic Authentication = Disabled.
System.Security.Principal.WindowsIdentity.GetCurrent().Name: Domain\User
I get the current user windows correctly but when I go to the web site has not css styles and exist javascript errors.
Javascript Error: Resource interpreted as Stylesheet but transferred with MIME type text/html
I have this web config:
<identity impersonate="true"/>
<authentication mode="Windows">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
I think that error is causing for IIS configuration. *All Folders Permissions : Everyone