Impersonation problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pankajprakash
    New Member
    • Feb 2007
    • 70

    Impersonation problem

    Hi All,

    I have created a User 'TestUser' and allow them to read/write permission on a file system in a machine. Whenever I logged in with the credential with TestUser then I can create/delete/access that file system. I have another machine where I have hosted a web service and used .net impersonation and passed the credential of TestUser to that web service. When I tried to create a file on that machine then it shows the error Access Denied. And If I used Administrator credential or another user's credential to create the file then it does not show any error and creates the files successfully. I do not understand what is the problem. Would you please let me know the solution?
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    Originally posted by pankajprakash
    Hi All,

    I have created a User 'TestUser' and allow them to read/write permission on a file system in a machine. Whenever I logged in with the credential with TestUser then I can create/delete/access that file system. I have another machine where I have hosted a web service and used .net impersonation and passed the credential of TestUser to that web service. When I tried to create a file on that machine then it shows the error Access Denied. And If I used Administrator credential or another user's credential to create the file then it does not show any error and creates the files successfully. I do not understand what is the problem. Would you please let me know the solution?
    As far as i can see, the "TestUser" does not have rights on your webservice machine...use an account the has access rights .. and make sure you use impersonation.. ..

    Comment

    • pankajprakash
      New Member
      • Feb 2007
      • 70

      #3
      Thanks for your replay. I have created an independent user account TestUser and allow him to loggin to that another machine (suppose MachineA). He can create/delete/access that particular file/folder on that machine. Now I had a web service on another machine (suppose MachineB). I had used impersonation with that TestUser credential. When I go to the impersonation function it return true, however when that web service create a file on MachineA it occours the error Access denied. I am still not able to understand the problem.

      Comment

      • PRR
        Recognized Expert Contributor
        • Dec 2007
        • 750

        #4
        Thats due to worker threads in asp.net and web service... check this...for more info...
        Or you could do this
        Code:
        <authentication mode="Windows" />
        <identity impersonate="true" />
        Turn off anonymous access in iis for this to work...

        Comment

        Working...