Form-based security and Application_AuthenticateRequest - help?!

Discussion in 'ASP .Net' started by Mike Kingscott, Jun 30, 2003.

  1. Hi there,

    Getting into ASP.Net finally, looks good but I'm having a bit of
    trouble here. I'm protecting my web site via form-based security (I
    won't go into the ins and outs, suffice to say it's all in one
    web.config file and not amazing). Basically, I'm holding a list of
    roles in a database for each user. Once the user has got past the
    login form, the Application_AuthenticateRequest fires. In there, I'm
    doing a database lookup on the user and then creating a
    GenericPrincipal using the User's Identity and the array of roles.
    It's great, it works, cool.

    UNFORTUNATELY, IT RUNS EVERY TIME THE PAGE IS LOADED. So that's a
    database lookup every time a page is requested - not good enough. I
    can't even store the array of roles in a Session variable because you
    don't get access to the session variable in
    Application_AuthenticateRequest , doh!

    I wish to keep my roles in the db, and I don't want to keep a list of
    users and passwords in the web.config file, or read them out of an XML
    file ('cos that would be the same problem).

    Any suggestions?

    Kind regards,

    Mike Kingscott
     
    Mike Kingscott, Jun 30, 2003
    #1
    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. Nugs

    Application_AuthenticateRequest

    Nugs, Apr 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,267
  2. Mad Scientist Jr
    Replies:
    1
    Views:
    376
    Svein Terje Gaup
    May 31, 2004
  3. Jaime
    Replies:
    9
    Views:
    423
    Dominick Baier [DevelopMentor]
    Jun 4, 2005
  4. jlynds

    Application_AuthenticateRequest and ASP.NET 2.0

    jlynds, Feb 12, 2006, in forum: ASP .Net Security
    Replies:
    0
    Views:
    348
    jlynds
    Feb 12, 2006
  5. Kursat
    Replies:
    1
    Views:
    339
    Dominick Baier
    May 7, 2007
Loading...

Share This Page