Impersonate in ThreadPool

Discussion in 'ASP .Net Security' started by Dominick Baier [DevelopMentor], Feb 3, 2005.

  1. Unfortunately impersonation tokens are not copied to new threads (this is 'fixed' in .NET 2.0).

    you have to impersonate the account on the new thread - that's the only solution.



    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<#>

    Hi all I have an ASP.NET application that uses impersonate account to connect to DB, this works good. But in some cases I need to put some methods in ThreadPool. The methods from ThreadPool should do some foreground operations with DB. But .NET throws me the sql exception "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.". The thread from pool in execution proccess has an ASPNET account different from my impersonated account. How can I resolve this problem, do you have any suggestions? with best regards
    Viorel
    This post contained attachments. By default, NewsGator will not download attachments, but can be configured to do so. If you wish to automatically download attachments for this newsgroup, go to NewsGator/Subscriptions, select this group and click Edit, and change the Options.


    [microsoft.public.dotnet.framework.aspnet.security]
    Dominick Baier [DevelopMentor], Feb 3, 2005
    #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. Scott Allen
    Replies:
    1
    Views:
    1,931
    Henri
    Dec 14, 2004
  2. Viorel Ghilas

    Impersonate in ThreadPool

    Viorel Ghilas, Feb 3, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    466
    Alvin Bruney [MVP]
    Feb 4, 2005
  3. Douwe
    Replies:
    0
    Views:
    712
    Douwe
    Dec 8, 2005
  4. Bill Belliveau

    DirectoryEntry Impersonate or WindowsIdentity Impersonate?

    Bill Belliveau, Jan 28, 2004, in forum: ASP .Net Security
    Replies:
    3
    Views:
    328
    Joe Kaplan \(MVP - ADSI\)
    Jan 31, 2004
  5. Viorel Ghilas

    Impersonate in ThreadPool

    Viorel Ghilas, Feb 3, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    90
    Viorel Ghilas
    Feb 3, 2005
Loading...

Share This Page