Sean Blakemore's Blog

Like trying to fit a square peg in a round hole

20. March 2012 11:44
by Sean

Multiple login pages with ASP.NET MVC

20. March 2012 11:44 by Sean | 0 Comments

I’m working on a multi-tenant web application where I need to have several different login forms for different types of users. For example for Admins, Affiliates, Customers etc.

The problem

This causes a problem because the Forms Authentication bits assume there will be a single login page for the whole application and it’s only possible to set a single loginUrl in the web.config to redirect users requesting pages which require authentication.