Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Batch job impersonation

Batch job impersonation

Scheduled Pinned Locked Moved ASP.NET
databasequestionsysadminhelpcareer
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hugo Hallman
    wrote on last edited by
    #1

    I use impersonation for my web-site to give the site access to one and only one database. Now, the problem is that the user token don't replicate to batch-threads that I start. So I must have duplicate connection strings. And two login accounts on the sql-server. One windows, and one sql-specific. I have tried to copy the user token manually, with no success. What is "the" way to work around this? I don't want to enter the password from the code, or a config-file if it's possible.

    J 1 Reply Last reply
    0
    • H Hugo Hallman

      I use impersonation for my web-site to give the site access to one and only one database. Now, the problem is that the user token don't replicate to batch-threads that I start. So I must have duplicate connection strings. And two login accounts on the sql-server. One windows, and one sql-specific. I have tried to copy the user token manually, with no success. What is "the" way to work around this? I don't want to enter the password from the code, or a config-file if it's possible.

      J Offline
      J Offline
      Jesse Squire
      wrote on last edited by
      #2

      You may want to take a look into using SSPI to impersonate the account. This[^] article on MSDN walks through creating a C# wrapper for the Win32 SSPI API. It is written in the context of .NET Remoting security but, if I recall correctly, the library is generic enough that it may work to solve your issue. At least, hopefully, it is a place to start. Hope that helps a bit. :) --Jesse

      H 1 Reply Last reply
      0
      • J Jesse Squire

        You may want to take a look into using SSPI to impersonate the account. This[^] article on MSDN walks through creating a C# wrapper for the Win32 SSPI API. It is written in the context of .NET Remoting security but, if I recall correctly, the library is generic enough that it may work to solve your issue. At least, hopefully, it is a place to start. Hope that helps a bit. :) --Jesse

        H Offline
        H Offline
        Hugo Hallman
        wrote on last edited by
        #3

        Thanks a lot! -Chee that was a heavy paper. I'll read it when I come back from vacations.:zzz:

        J 1 Reply Last reply
        0
        • H Hugo Hallman

          Thanks a lot! -Chee that was a heavy paper. I'll read it when I come back from vacations.:zzz:

          J Offline
          J Offline
          Jesse Squire
          wrote on last edited by
          #4

          My pleasure. :) I've read the article a couple of times now, and still don't think that I've managed to stay coherent all the way through. :wtf: There is a lot of stuff there. --Jesse

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups