ASP.NET using impersonation cannot access network shared drive

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

  1. #1

    Default ASP.NET using impersonation cannot access network shared drive

    I have a ASP.NET application with web.config specified:
    <identity impersonate=true/>
    <authentication mode="Windows" />

    If I login to the client browser as JSMITH and have the server code trying to access a network shared drive via Directory.GetFiles("\\\\machineb\\sharedriveb"), I get an access deny error. JSMITH has full rights to access \\machineb\sharedriveb and its contents.

    If the server code access a local folder with only access to JSMITH, I have no problems with JSMITH logging in via the client browser.

    The only difference I see is that it cannot access network resources. My understanding is that ASP.NET will use the impersonated token to run the code and hence the impersonated token (JSMITH) has access to the resource.

    Any suggestions?
    benny Guest

  2. Similar Questions and Discussions

    1. #40117 [NEW]: Unable to access mapped network drive
      From: jsbruns at selectionsheet dot com Operating system: Windows 2003 Server PHP version: 5.2.0 PHP Bug Type: Filesystem...
    2. Windows authentication with impersonation - network resource access fails
      Hi, I have a question regd. Windows authentication and network file access. My asp.net application doesn't use any of the .NET's authentication...
    3. Access shared drive using FORM based authentication
      Hi All, I am using FORM BASED authentication for my web based application. It's running under ASPNET account on win2k server and NetworkService...
    4. ASP.NET application cannot access network drive
      My ASP.NET application needs read/write permissions for drive "Z:", which is mapped to my Linksys Gigadrive (Network Attached Storage...if anyone...
    5. ASP.NET application cant access network drive
      My ASP.NET application needs read/write permissions for drive "Z:", which is mapped to my Linksys Gigadrive (Network Attached Storage...if anyone is...
  3. #2

    Default RE: ASP.NET using impersonation cannot access network shared drive

    Hi Benny,

    Your understanding is correct. ASP.NET is going to execute that thread
    under the identity of the user who is authenticated in IIS. The problem
    your having is likely that you are attempting to allow IIS to delegate your
    credentials to the file server using NTLM authentication. That is
    explicitly designed to fail in our architecture because it would allow
    someone to spoof your identity.

    The solution is to set up delegation which would then allow you to use
    Kerberos authentication. That would allow you to have your credentials
    delegated to the file server from IIS. Here's an article link:

    [url]http://support.microsoft.com/default.aspx?scid=KB;EN-US;810572[/url]

    There's also considerable information about this and other security issues
    in the "Building Secure ASP.NET Applications" book. Here's an excerpt:

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/ht[/url]
    ml/secnetlpMSDN.asp?frame=true

    Jim Cheshire [MSFT]
    MCP+I, MCSE, MCSD, MCDBA
    Microsoft Developer Support
    [email]jamesche@online.microsoft.com[/email]

    This post is provided "AS-IS" with no warranties and confers no rights.


    --------------------
    >Thread-Topic: ASP.NET using impersonation cannot access network shared
    drive
    >thread-index: AcRrdKc7uDtnUuFSSnWHM1/IpzWFHw==
    >X-WBNR-Posting-Host: 63.166.226.115
    >From: "=?Utf-8?B?YmVubnk=?=" <benny@discussions.microsoft.com>
    >Subject: ASP.NET using impersonation cannot access network shared drive
    >Date: Fri, 16 Jul 2004 13:37:03 -0700
    >Lines: 11
    >Message-ID: <6126BBFB-EBD2-43AC-B3E5-7E095F391E3F@microsoft.com>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.security
    >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 127.0.0.1
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet.security: 10843
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
    >
    >I have a ASP.NET application with web.config specified:
    ><identity impersonate=true/>
    ><authentication mode="Windows" />
    >
    >If I login to the client browser as JSMITH and have the server code trying
    to access a network shared drive via
    Directory.GetFiles("\\\\machineb\\sharedriveb"), I get an access deny
    error. JSMITH has full rights to access \\machineb\sharedriveb and its
    contents.
    >
    >If the server code access a local folder with only access to JSMITH, I
    have no problems with JSMITH logging in via the client browser.
    >
    >The only difference I see is that it cannot access network resources. My
    understanding is that ASP.NET will use the impersonated token to run the
    code and hence the impersonated token (JSMITH) has access to the resource.
    >
    >Any suggestions?
    >
    Jim Cheshire [MSFT] 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