With WebForms I don't have a problem with forms authentication, but it's giving me grief in MVC 5
Added Secure
to Areas, then Landing and Login
In the main web.config file added this under system.web (also variants like ~/Secure/Login
)
<authentication mode="Forms">
<forms loginUrl="Secure/Login" />
</authentication>
And sub web.config file (under secure) this (sorry indent wouldn't work so used code snippet)
<location path="">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
<location path="Login">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
But for some reason it doesn't work.
Added this to Startup.Auth and it works perfectly