Re: Need to create in-memory store for authorization roles

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Raterus (moc.liamtoh_at_suretar.reverse)
Date: 08/12/04


Date: Thu, 12 Aug 2004 10:46:41 -0400

It may not be an option for you, but I've always used an encrypted cookie, this is when I use forms authentication though. When AuthenticateRequest comes along, I unencrypt the cookie, assign the roles, and attach it to the context.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT04.asp

Hope this helps,
--Michael

"Bill Borg" <BillBorg@discussions.microsoft.com> wrote in message news:523F2D23-2F1E-4F3D-9A92-A83649B0271E@microsoft.com...
> Hello,
>
> I want to build user roles during AuthenticateRequest for use during
> authorization. I know I can go get the roles from the database and add them
> to the principal, but would like to cache the roles in memory rather than
> always go to the database. I'd like to use the equivalent of the session, but
> know that at the point where I need this the session state bag is not yet
> reestablished.
>
> Any thoughts on how best to create an in-memory store for user roles?
>
> Thanks,
>
> Bill Borg



Relevant Pages

  • Re: Windows Authentification against a list of users
    ... This might be a better question posed to the aspnet security newsgroup as ... I'm kind of surprised that AuthenticateRequest gets called if the user ... >> One thing you might do would be to validate against a group in the ... >> as your list of allowed users instead of your database though. ...
    (microsoft.public.dotnet.security)
  • RE: IsInRole always returns false?
    ... after AuthenticateRequest there is a undocumented event called DefaultAuthentication ... >> I'm using Windows authentication with impersonation turned on but I ... >> wanted to pull user roles from my database. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: HttpContext.Current.User.Identity.IsAuthenticated
    ... no - the IPrincipal on Context.User is created in the AuthenticateRequest ... public virtual bool IsAuthenticated ... > Just wondering if I should perform this once when a user logs into my ... > site then store in a session as to not repeatidly hit the database as ...
    (microsoft.public.dotnet.framework.aspnet.security)