CurrentPrincipal and new Thread

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default CurrentPrincipal and new Thread

    I have an ASP webapp that needs to access files using a UNC pathname to a
    network-share

    I setup "impersonation" and that all works as expected when executed in the
    CurrentThread.

    I need to kick-off a Method which will need exactly the same permissions
    inside a new,long running, low priority Thread.

    Problem is even if I set the new Thread's.CurrentPrincipal =
    oldThread's.CurrentPrincipal ,
    it displays the correct Identity.Name in the new Thread, but doesnt actually
    adopt that old principal.

    It moans about logon failure, and won't acually give me access to the Remote
    Share.

    One defffinite Solution is to Change the <processModel userName="..."
    password=".."> tag in machine.config,
    but this causes other problems as I have other WebApps that don't like
    running under another account.
    (and I don't think it's the right way to do it?)



    Is there maybe a way to use one of the ThreadPools Threads for this job?
    or is there a better way to do this?


    Any Ideas?










    marcell@ids.co.za Guest

  2. Similar Questions and Discussions

    1. Newbie:Using ASP.NET thread pool thread to dispatch TCP data, etc.
      Hi, I've an ASP.NET web service which distributes events to clients via TCP. Environment is IIS6 on Windows 2003 server with .NET framework 1.1...
    2. Can an iFrame share a System.Threading.Thread.CurrentPrincipal
      As per the subject line, I have a sub asp.net app that is being displayed in a parent asp.net app. The sub must respect the roles assigned to the ...
    3. CurrentPrincipal, WindowsPrincipal
      Hello Friend Please check following Cod Dim x As System.Security.Principal.WindowsPrincipa x = System.Threading.Thread.CurrentPrincipa...
    4. HttpContext.Current.User vs. Thread.CurrentPrincipal
      How are HttpConext.Current.User and Thread.CurrentPrincipal different? It seems that they can be set differently in different places. Why would...
    5. [PHP-DEV] Ifx - Help ! losing my mind, thread by thread
      --------------010000080604040703060106 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, Please...
  3. #2

    Default RE: CurrentPrincipal and new Thread

    I think you may consider call WIN API LogonUser in the code to implement
    the impersonation. It also can make current thread run at a particular
    account. you may refer to following article to see if it will help:

    INFO: Implementing Impersonation in an ASP.NET Application
    [url]http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q306158[/url]

    Luke

    [MSFT] Guest

  4. #3

    Default RE: CurrentPrincipal and new Thread

    Hello,

    How is everything going? If you have any more questions on this issue,
    please feel free to post here and we will follow up.

    Thanks very much.

    Best regards,
    Yanhong Huang
    Microsoft Community Support

    Get Secure! ¨C [url]www.microsoft.com/security[/url]
    Register to Access MSDN Managed Newsgroups!
    -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
    p&SD=msdn

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Yan-Hong Huang[MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139