Posted in General

Accessing network resources in .NET

Ok now we have weird requirement. The requirement could be realised as follows, even though my requirement is little different. Every product has some documents associated with it. When public user asks for a document, he should be given the file. These files are located on shared drives on network. When ASP.NET Application runs it runs under ASPNET account. This is local account and cannot access network resources. The company does not want to give aspnet account the previledge to access the resources on network drives, they want us to use some predefined user name. So our web app must run under that username. Again the client doesn’t want the app to use the username all the time.

Now, the solution was simple. We need to do impersonation. When the user asks for the file, web app must impersonate as network user, get the file, stream it on to browser and change back to old username.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s