Multiple Logins in Forms Authentication??

N

Nicolas Bottarini

Hi!!
I have a site with a backend subdirectory with the backend of the site.
I need that the site to have one login and the backend directory
another one. Is this possible with Forms Authentication??
What can i do??

Thanks

Nicolas
 
K

Ken Dopierala Jr.

Hi Nicolas,

I would look into using Roles with your Forms Authentication. When you
verify your users credentials you also get their roles, if they are in an
Admin role then you can give them access to the backend directory. If they
are only in the Member role then they have no access. You can assign more
than 1 role to a user so you'll never need to do additional checks. In your
web.config file place <location> tags to have ASP.Net manage everything via
Roles for you (the <location> tags go right at the top of the web.config
file as below):

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="Members">
<system.web>
<authorization>
<allow roles="Member, Administrator"></allow>
<deny users="*"/>
</authorization>
</system.web>
</location>

<location path="Members/Backend">
<system.web>
<authorization>
<allow roles="Administrator"></allow>
<deny users="*"/>
</authorization>
</system.web>
</location>
..
..
..

Note that if you don't assign multiple roles to your users then you can
allow multiple roles access in the <location> tags. Good luck! Ken.
 
N

Nicolas Bottarini

Thank you very much for the reply Ken. The problem is that an admin
user can be logged in the frontend. Apart from that, I need 2 logins
with different UI.
How does all the people to make their backends?? They make a different
application??
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top