Why is my ASP.NET MVC application asking for Windows Authentication?
I am creating an ASP.NET MVC application and using forms based authentication. In my management I have:
[Authorize (Users = "me, joe")]
which works great. Last night when I posted the newest changes and tried to browse my site, it got the Windows Authentication dialog box. I've looked through all of my code and can't figure out WHY it will change to Windows Authentication. My web.config file hasn't changed for at least 10 days. If I run the code from my dev module it won't do it ... only when it is run from my host. And if I remove the Authorize line from my controller action, it doesn't.
How can I fix this or how can I debug my solution to see why this is happening?
By the way, my web.config says:
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
a source to share
I'm just shooting in the dark, but do you have a setting <identity>
in your web.config?
<system.web>
...
<identity impersonate="true"/>
...
</system.web>
If so, it might help remove that line. It might also help to ask your hosting provider why Windows Authentication is suddenly being applied to your website. As mentioned, there are IIS settings that can cause this behavior.
a source to share
I think you need to set permissions for IUSER, IWAM
Use Windows Explorer to find the folder where you want to grant permissions. Right click on the folder and select "properties". In the dialog that appears, click the Security tab at the top. Then you can add or change the security of these accounts (IUSR_machineName, IWAM_macnineName, and ASPNET).
a source to share