I need a really simple password protection for a certain folder in my MVC-4 application. By simple I mean: no database validation, no ASP membership, no forms authentication, no OpenID, etc.
There will be only one user allowed to have access to the views in a folder called "Admin": Username "ABV" and password "myPassword". Again: I do not have high security requirements. It's more about keeping users outside who tried to enter certain dialogs by accident.
I was hoping for a way to just bring up the Windows Authentication dialog as soon as I hit the Admin folder the first time.
Some posts on this forum suggest to put this in the web.config:
<location path="Admin">
<system.web>
<authorization>
<deny users="?"/>
<allow users="ABV"/>
</authorization>
</system.web>
On my server I added a Windows user called "ABV" with the password mentioned above.
When I try to access a view in the Admin folder, I'm getting a 404 error. No password dialog appeared.
I have also been playing around with the settings of my web server (IIS6), like unchecking "Enable anonymous access". But what ever I did, it didn't help.
I'm sure I missed something obvious and hope that somebody can help me out here.
Thanks guys! Ingmar