Trouble setting security for new thread in web app.

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

  1. #1

    Default Trouble setting security for new thread in web app.

    Hello,

    I have a web app that is being used to restore sql databases. Iam using a new thread to do the sql restores so I can keep theweb page from timing out (it checks a database to see thestatus, etc.) My problem is that I have tried just abouteverything to give that thread the domain username and passwordthat is setup for it on the network. As soon as the threadstarts, it goes straight to the machine name for the login.

    I have read things that are very close to what I need on here butnothing that really pinpoints it. I thought about making thefunction into a service but feel i'm very close. Here is my codewhere I call the thread:

    tDBRestore = New Thread(AddressOf RestoreDB)
    tDBRestore.Name = "tRestoreDB"
    tDBRestore.Start()

    .NET is impersonating the logged in user, which is great, untilit hits the new thread.

    Thanks,
    Bo

    --------------------------------
    From: Bo Campbell

    -----------------------
    Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])

    <Id>L3FjwIaSUEGkXsto7LXw/Q==</Id>
    Bo Campbell via .NET 247 Guest

  2. Similar Questions and Discussions

    1. Can't get the security setting i need
      Why can't I create a security setting that creates a password to open an attachment as well as a permissions password that does not allow printing or...
    2. setting security
      Hi all gurus, it's the very 1st time I attempt to build a Web Service app, and while simple samples work fine, I stuck trying to fill (on server...
    3. Need help. Having trouble with security on my web service.
      I am getting an access denied 403 error when I try to access my web service. My IIS setting is set to use only Windows Authentication. The client...
    4. Trouble setting inch marks in text – Iluustrator CS
      Our agency has had trouble having inch marks show up in text (versus quote marks) in Illustrator CS. We have turned the smart quote feature on and...
    5. Trouble setting the web.config to use my class
      Hey Everyone, I am building a store application that is on an unsecured server. We got one of those shared certificates that takes you from (ex....
  3. #2

    Default Re: Trouble setting security for new thread in web app.

    Unfortunately v1.1 does not transmit the security context (i.e. , principal,
    thread token, etc) to the newly created thread. If you don't want to use a
    thread from the .NET thread pool (as I guess is your scenario), you would
    have to pass the security context (principal object might be suffice) to
    your callback method like any other parameter that might receive your
    method. On your callback method, you may impersonate with
    yourprincipal.Identity.Impresonate() (and don't forget to "Undo" on your
    finally section) or just attach this principal to the thread's principal
    with Thread.CurrentPrincipal = yourprincipal.

    --
    Hernan de Lahitte
    Lagash Systems S.A.
    [url]http://weblogs.asp.net/hernandl[/url]


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

    "Bo Campbell via .NET 247" <anonymous@dotnet247.com> wrote in message
    news:ui9k9FieEHA.732@tk2msftngp13.phx.gbl...
    Hello,

    I have a web app that is being used to restore sql databases. I am using a
    new thread to do the sql restores so I can keep the web page from timing out
    (it checks a database to see the status, etc.) My problem is that I have
    tried just about everything to give that thread the domain username and
    password that is setup for it on the network. As soon as the thread starts,
    it goes straight to the machine name for the login.

    I have read things that are very close to what I need on here but nothing
    that really pinpoints it. I thought about making the function into a service
    but feel i'm very close. Here is my code where I call the thread:

    tDBRestore = New Thread(AddressOf RestoreDB)
    tDBRestore.Name = "tRestoreDB"
    tDBRestore.Start()

    ..NET is impersonating the logged in user, which is great, until it hits the
    new thread.

    Thanks,
    Bo

    --------------------------------
    From: Bo Campbell

    -----------------------
    Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])

    <Id>L3FjwIaSUEGkXsto7LXw/Q==</Id>


    Hernan de Lahitte 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