You cannot use routing files or web.config to protect your MVC expression. The only supported way to protect your MVC application is to apply the [Authorize] attribute for each controller and action method (except for login / registration methods). Securing solutions based on your current area is a very bad thing and your application will open to vulnerabilities.
You can read it here .
You can control your authentication method in the web.config file :
<authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" defaultUrl="~/Home/Index" timeout="2880" protection="All" slidingExpiration="true" /> </authentication>
then you should use the [Authorize] attribute for the controller / action you want to protect.
Generally, you do not want to protect the account controller.
Another useful link.
source share