When is impersonation 'on'?

Discussion in 'ASP .Net' started by Brian, May 14, 2008.

  1. Brian

    Brian Guest

    Greetings!

    I'm trying to find a good place to call SqlCacheDependency.Start() and
    I'm running into some issues. I know this isn't a SQL forum, but this
    seems more like an ASP.NET lifetime problem.

    I treid Application_Start() but we're running with anon access and
    impersonation, and impersonation is not 'on' yet.

    I considered impersonating my user in Application_Start() but I'm not
    wild about this as I think I'll need the password, etc. I'd rather
    keep that out of my app.

    I tried overriding Init() in global.asax with the same results as
    Application_Start.

    I tried Application_BeginRequest() but we've got some HttpModules that
    do database access themselves that use cache. IHttpModule.BeginRequest
    seems to run BEFORE Application_BeginRequest, so SqlCacheDependency
    activity fails. Interestingly, impersonation is ON in
    IHttpModule.BeginRequest!

    I tried overriding Init() in the HttpModule but no impersonation.

    I can't use Session_Start() because I'm not using session state at
    all.

    So it looks like the only place I can reliably call
    SqlCacheDependency.Start() is in the BeginRequest() method of my FIRST
    HttpModule, which places it before any DB/cache activity, with
    impersonation on. I'd need to use a singleton pattern to ensure it
    only happens once.

    Am I missing something? Does this make sense? Gives me the willies...

    Thanks to all!

    -Brain
     
    Brian, May 14, 2008
    #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. Kelly D. Jones

    Problem with impersonation and delegation

    Kelly D. Jones, Sep 4, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,851
  2. Pramod

    Impersonation code

    Pramod, May 12, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,688
  3. Raymond Basque

    Re: ASP.NET Fails after SP4 with Impersonation

    Raymond Basque, Jun 27, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    550
  4. Bassel Tabbara [MSFT]

    RE: ASP.NET Fails after SP4 with Impersonation

    Bassel Tabbara [MSFT], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    526
    Michael Kennedy [UB]
    Jun 28, 2003
  5. Hidulf
    Replies:
    1
    Views:
    474
    Michael Kennedy [UB]
    Jun 30, 2003
Loading...

Share This Page