Conditional forms authentication

Discussion in 'ASP .Net' started by ajitgoel@gmail.com, Apr 4, 2007.

  1. Guest

    Hi;

    I am using forms authentication for some new aspx screens in our site.
    These pages need to be not accessible to users who do not have certain
    rights while they need to be accessible to users who have these
    rights. These rights would be determined at runtime and would come
    from a webservice. Basically this is what I want to do

    User has rights and user clicks on a page section that requires
    logging in,
    =>redirect user to login page
    =>User logs in and the system redirects him to the originally
    requested page section.

    User does not have rights and user clicks on a page section that
    requires logging in,
    =>the system redirects him to the originally requested page section.

    Also these new pages cannot be accessible to users who do not have the
    appropriate rights.

    Where would I write code to handle this "if else" case?? Would the
    Page_PreInit method of the login page, be a good place or should I do
    it in the global.asax's FormsAuthentication_OnAuthenticate event?? Is
    it possible declaratively (in web.config possibily)?? I would not like
    to make changes to the old screens as they are too huge in number and
    would need to be retested for all scenarious.

    Pointers\comments are higly appreciated.

    Thanks,
    Ajit Goel
    , Apr 4, 2007
    #1
    1. Advertising

  2. David Guest

    Most of the examples of FormsAuthentication show you to create a folder and
    secure that folder by your web.config, so that any pages in that folder that
    are requested will result in the loginpage (also defined in web.config) to
    be shown.

    If a person has no access, then they don't get access to your pages.

    --
    Best regards,
    Dave Colliver.
    http://www.AshfieldFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available
    <> wrote in message
    news:...
    > Hi;
    >
    > I am using forms authentication for some new aspx screens in our site.
    > These pages need to be not accessible to users who do not have certain
    > rights while they need to be accessible to users who have these
    > rights. These rights would be determined at runtime and would come
    > from a webservice. Basically this is what I want to do
    >
    > User has rights and user clicks on a page section that requires
    > logging in,
    > =>redirect user to login page
    > =>User logs in and the system redirects him to the originally
    > requested page section.
    >
    > User does not have rights and user clicks on a page section that
    > requires logging in,
    > =>the system redirects him to the originally requested page section.
    >
    > Also these new pages cannot be accessible to users who do not have the
    > appropriate rights.
    >
    > Where would I write code to handle this "if else" case?? Would the
    > Page_PreInit method of the login page, be a good place or should I do
    > it in the global.asax's FormsAuthentication_OnAuthenticate event?? Is
    > it possible declaratively (in web.config possibily)?? I would not like
    > to make changes to the old screens as they are too huge in number and
    > would need to be retested for all scenarious.
    >
    > Pointers\comments are higly appreciated.
    >
    > Thanks,
    > Ajit Goel
    >
    David, Apr 4, 2007
    #2
    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. Eric
    Replies:
    2
    Views:
    1,405
    Tommy
    Feb 13, 2004
  2. Alec S.
    Replies:
    10
    Views:
    10,091
    Alec S.
    Apr 16, 2005
  3. JEFF
    Replies:
    1
    Views:
    1,007
    =?Utf-8?B?YnJpYW5zW01DU0Rd?=
    Nov 12, 2007
  4. Keltex
    Replies:
    1
    Views:
    388
    Dominick Baier [DevelopMentor]
    Jan 24, 2006
  5. Eric
    Replies:
    2
    Views:
    467
Loading...

Share This Page