? - Database Query & Saving to Application Cache
From: Raja (raja12345_at_mail.com)
Date: 03/25/04
- Previous message: Alek Davis: "Re: Windows Auth -- double hop issue??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 25 Mar 2004 10:00:42 -0700
I have an ASP.NET application that uses Windows authentication and impersonation. In my Global.asax file--the Application_Start event--I have code to access and query my database to store a dataset into Application Cache. However, I get a DB permissions error.
The call to the database in the Global.asax file is using MACHINENAME\ASPNET (which doesn't have access to my database), not the authenticated user DOMAINNAME\USERNAME (which does have database access). So, it seems as though ASP.NET impersonation doesn't happen until after the Application_Start event has fired in Global.asax. Does this sound correct? Or, am I missing something else?
Anyway, to the real question: Using Windows auth. with impersonation, where is the best place to query a database to store a dataset into Application Cache? And, how? Right now it works in Session_Start, but then every user that accesses the app. also queries the database.
Thanks for you help.
- Previous message: Alek Davis: "Re: Windows Auth -- double hop issue??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]