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. Impersonate using credentials of currently logged on user.

Impersonate using credentials of currently logged on user.

Scheduled Pinned Locked Moved ASP.NET
sysadminhelptutorial
3 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.
  • J Offline
    J Offline
    jdkulkarni
    wrote on last edited by
    #1

    Hi, I am having one problem. I have one web application calling web service, say webservice1. Webservice1 calls webservice2 which reads a file from the network and sends back the response. The problem is web application, webservice1 and webservice2 are all running under network service account. Network service account does not access to network resources. Hence, in the webservice2 I have to find the currently logged on user and impersonate it. After that the code will work fine. The problem is, how to get the currently logged user and impersonate it when I am not having his password. :^) Regards, Jayant

    M 1 Reply Last reply
    0
    • J jdkulkarni

      Hi, I am having one problem. I have one web application calling web service, say webservice1. Webservice1 calls webservice2 which reads a file from the network and sends back the response. The problem is web application, webservice1 and webservice2 are all running under network service account. Network service account does not access to network resources. Hence, in the webservice2 I have to find the currently logged on user and impersonate it. After that the code will work fine. The problem is, how to get the currently logged user and impersonate it when I am not having his password. :^) Regards, Jayant

      M Offline
      M Offline
      mail572352
      wrote on last edited by
      #2

      In IIS 6.0 you can always assign the web service you want to give more access rights to, a custom application pool with the account set to "SYSTEM" or even to log on as a user on the server you can set up with just the permissions your web service needs.

      J 1 Reply Last reply
      0
      • M mail572352

        In IIS 6.0 you can always assign the web service you want to give more access rights to, a custom application pool with the account set to "SYSTEM" or even to log on as a user on the server you can set up with just the permissions your web service needs.

        J Offline
        J Offline
        jdkulkarni
        wrote on last edited by
        #3

        Yes, you are right. But that will make whole web service running in authenticed mode. I want to run a piece of code under the context of currently logged on user. Jayant

        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