Re: Impersonate user from ASP.NET - access to network file share

From: Paul Clement (UseAdddressAtEndofMessage_at_swspectrum.com)
Date: 12/09/04


Date: Thu, 09 Dec 2004 09:58:15 -0600

On 8 Dec 2004 11:31:21 -0800, Michelle@bwalk.com (Michelle) wrote:

¤ Hello!
¤
¤ I have an ASP.NET application (1.1 framework) that needs to be able to
¤ read/write files on a network share. The access to this file share
¤ will be fairly restricted, so I need to impersonate a specific user
¤ account on our domain in order to gain access. The impersonation is
¤ only needed for the sections that reads/writes files. I have tried
¤ using the code from http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q306158#4
¤ and many other similar sources with no success. I do not get any
¤ errors, but I am not logged in using the username and passoword I
¤ provide so I cannot access the network (it remains the anonymous
¤ user). I have tried putting the impersonation code into a Class
¤ Library and calling that from the web application with the same
¤ results.
¤

If you're accessing a resource that is not located on the web server then you will probably need to
implement delegation:

How to configure an ASP.NET application for a delegation scenario
http://support.microsoft.com/default.aspx?scid=kb;en-us;810572

Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)



Relevant Pages

  • RE: Can I get some help here! Posted 10/4/04 - no reply there
    ... You say if you use impersonation, you get the file not found message. ... If the file you want is on the C: drive of your machine but the web server ... Sample snipet of source code is as ... When I use the network ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Security risks when running IIS without static ip as localhost
    ... > access this web server, it is purely for developing asp pages which will ... > network to a security risk. ... For example, one vector of compromise is someone receives, say, a worm email ...
    (microsoft.public.inetserver.iis.security)
  • Re: How vulnerable server will become if placed on DMZ ?
    ... >> I have a type of Web Server. ... > protect your internal network from a compromised web server. ... A DMZ can ... > network as compared to what you probably have now, a single firewall. ...
    (microsoft.public.win2000.security)
  • Re: oops again
    ... > When you want expose the web server on the local network to the internet, ... > to the internal IP of your web server. ... > You configure the Firewall on the Router to just block every single port. ... > network but does not prevent your PCs from contacting the Internet. ...
    (microsoft.public.inetserver.iis)
  • Re: NAT Settings for exposing an internal web server to the outside world?
    ... However the client machines that are trying to access the web server are behind the same router. ... Network A: 192.168.6.0/24 Call this the backbone network. ... 192.168.12.0/24 network containing the client machines that are trying to access the web server. ...
    (microsoft.public.windows.server.networking)