MVC4 areas and forms authentication

Viewed 6360

I have an MVC4 application set up with multiple areas. Each area must have its own login page. Let's say for example I have the following areas:

Main Admin

How can I set it so that the "Main" area has a different login page to the "Admin" area? I'm thinking web.config is not the way to go on this.

Currently I have the following in my root web.config file:

<authentication mode="Forms">
  <forms loginUrl="~/Admin/Login" timeout="2880" protection="Encryption" />
</authentication>

However, I'm struggling to work out how to adapt this to MVC4 with areas.

Please help.

2 Answers
Related