Multiple login forms in one web application

S

Sergey Kuleshov

Hello all!



Is there any way I can have two different login areas in one web
application? I have user portal, to which customers can login and I have
admin panel. Using roles doesn’t really help here, cause customers and
admins are entirely different entities. Furthermore design of their login
pages will be different.



I know that forms authentication doesn’t support this natively, but
probably there is a known pattern?



Thank you!
 
C

Cowboy \(Gregory A. Beamer\)

I would separate the logic into two applications, even if the URLs end up looking something like:

http://mysite.com/admin
http://mysite.com/customer

You may also have a top level application, from a logical point of view:

http://mysite.com

Hope this helps

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
Hello all!



Is there any way I can have two different login areas in one web application? I have user portal, to which customers can login and I have admin panel. Using roles doesn’t really help here, cause customers and admins are entirely different entities. Furthermore design of their login pages will be different.



I know that forms authentication doesn’t support this natively, but probably there is a known pattern?



Thank you!
 
C

Cowboy \(Gregory A. Beamer\)

Roles are then your best option, even if you have to set up a custom provider to handle the roles. Find common elements of admin and customer and put in a class that both are inherited from. You can then cast as customer or provider, as needed. This may not be an option if they have nothing in common, however.

You can logically separate the branches, using folders, and set up a factor that returns either the parent class or even an object. The farther up the stack you go, the more generic, and the more you will have to test to make sure you are not killing yourself.

If none of these options work, you are going to write a lot of code to handle whether a person is a customer or admin. One option, that might work, is a user object that stores either a customer or admin and can return either object, depending on the user's role.

If none of those work, you are back to writing a lot of code.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
I’d really like to avoid this, as the applications will share a number of web user controls.





I would separate the logic into two applications, even if the URLs end up looking something like:



http://mysite.com/admin

http://mysite.com/customer



You may also have a top level application, from a logical point of view:



http://mysite.com



Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top