Multiple Logins in Forms Authentication??

Discussion in 'ASP .Net' started by Nicolas Bottarini, Mar 10, 2005.

  1. 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
     
    Nicolas Bottarini, Mar 10, 2005
    #1
    1. Advertising

  2. 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.

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight
    If you sign up under me and need help, email me.

    "Nicolas Bottarini" <> wrote in message
    news:...
    > 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
    >
     
    Ken Dopierala Jr., Mar 11, 2005
    #2
    1. Advertising

  3. 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??
     
    Nicolas Bottarini, Mar 11, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    698
    amjathrahman
    Jul 20, 2006
  2. Sameer

    preventing multiple logins

    Sameer, Oct 20, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    411
    Sameer
    Oct 20, 2003
  3. Eric
    Replies:
    2
    Views:
    1,562
    Tommy
    Feb 13, 2004
  4. Conformix Sales

    Stopping multiple logins in ASP.Net

    Conformix Sales, Nov 7, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    4,136
  5. Eric
    Replies:
    2
    Views:
    641
Loading...

Share This Page