Forms authentication - Multiple login forms based on directory acc

K

Keltex

I want to use ASP.NET 2.0 forms authentication for my new website. I have two
different distinct types of user roles... "member" and "admin" each should
have access to the /member and /admin directories respectively.

I can make all that work, but the main question I have is with forms
authentication it seems that you can only have ONE default login form for the
entire application. (loginUrl="~/member/Login.aspx") What I would like is to
be able to redirect the user to a different login form based on which area
they are trying to access. For example if a user goes here
/member/default.aspx and is not authenticated, they would be sent to
/member/login.aspx. Likewise, if they are not authenticated and try to access
/admin/default.aspx, they are sent to the login form at /member/login.aspx.

I assume I need to handle via the AuthenticateRequest or
PostAuthenticateRequest application events, but I have no idea where to
start...

Any ideas?

- BK
 
D

Dominick Baier [DevelopMentor]

Hi,

this is not possible. You can however detect in your login page from which
area the user is getting forced to login - inspect the ReturnUrl query string.
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top