Impersonate at runtime

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

  1. #1

    Default Impersonate at runtime

    Hi,

    I want to move my files from web servers to a shared
    folder on the database server. For this I impersonate the
    aspnet user to common domainuser and gave write
    permissions for that user on the folder on the database
    server.

    During run time it impersonates to the domainuser but it
    throws an error
    "System.UnauthorizedAccessException: Access to the
    path "\\DBServer\Files\Test3.xls" is denied"

    The code i wrote is
    File.Move("C:\\Inetpub\\wwwroot\\CoradPhase2
    \\Files\\Test3.xls","\\\\DBServer\\Files\\Test3.xl s");

    It works fine if write the identity tag on the web config.
    Any help is good and Thanks

    Thanks
    Anand

    Anand Guest

  2. Similar Questions and Discussions

    1. Impersonate + AD
      Hi, I've got a difficult situation... Is a website that runs on IIS with Anonymous Authentication, the tag <identity impersonate="false"> on the...
    2. Asp.net impersonate
      I don't think impersonation loads the user profile of the account being impersonated. If you think about it, that would make impersonation very...
    3. Impersonate a user
      Hi guys, I am working for an asp app with the use of sql 2000, COM+ and iis 5.0. In part of the solution, some files (lotus notes related) will...
    4. DirectoryEntry Impersonate or WindowsIdentity Impersonate?
      Another security question. Our project interfaces with the Active Directory. To satisfy the security issues, we have a couple options when we talk...
    5. impersonate
      Hi all, I create a aspnet web app for my company. I set it up on a win2000 server with IIS5 as a intranet app. For security, I want to restrict...
  3. #2

    Default Impersonate at runtime

    I'm having some similar issues, and perhaps can help a
    bit...

    Impersonation is used to impersonate a client on -that-
    machine, in ASP.NET the web server.
    I.E. If User is logged on Computer A, and accessing a web
    site and other resources on B using his credentials, that
    is impersonation.

    However, if logged on to A, accessing B, and -then- you
    want to have B send those same credentials on to a
    resource on computer C (your shared drive), then that is
    called "Delegation". From your description, it sounds
    like that is your scenario.

    There are a number of requirements for Delegation,
    primarily the use of Windows Authentication, and marking
    the accounts/computers (depending on setup) as 'Trusted
    for Delegation' within Active Directory. You also have to
    use Kerberos authenication, which is only compatible with
    certain browsers/OS's.

    My problem is that I can't get Kerberos to work.

    In this case, I appear to have 2 options. 1 is to use
    Basic Authentication. This sends the password in clear
    text, and (I'm oversimplifying, so I apologies to the
    experts) effectively just reusing the same username and
    password. So as I've recently learned, that's not true
    delegation, but the end result is the same, but with less
    security in the logon method.

    Another option is to create a domain account that's a
    member of IIS_WPG (on W2003 at least), and have IIS run
    under that account. Then when you need to access those
    resources, you can call "RevertToUser" using an API (less
    difficult than it may sound) and use those credentials
    (which don't have to be delegated since that account is
    actually logged on to Computer B) to save the file, and
    then start impersonating again.

    Hopefully though, you'll have more luck than I getting
    Kerberos to work. That certainly is the preferred
    solution. Do a search on setting up Delegation with
    Kerberos and I think you'll find some helpful resources.



    >-----Original Message-----
    >Hi,
    >
    >I want to move my files from web servers to a shared
    >folder on the database server. For this I impersonate the
    >aspnet user to common domainuser and gave write
    >permissions for that user on the folder on the database
    >server.
    >
    >During run time it impersonates to the domainuser but it
    >throws an error
    >"System.UnauthorizedAccessException: Access to the
    >path "\\DBServer\Files\Test3.xls" is denied"
    >
    >The code i wrote is
    >File.Move("C:\\Inetpub\\wwwroot\\CoradPhase2
    >\\Files\\Test3.xls","\\\\DBServer\\Files\\Test3.x ls");
    >
    >It works fine if write the identity tag on the web config.
    >Any help is good and Thanks
    >
    >Thanks
    >Anand
    >
    >.
    >
    Geof Nieboer 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