Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I am working on ASP.NET 2005,

I wants to make sure, is there any other way to access a file in a server without using tag below in web.config file

identity impersonate="true" userName="rajkumar.t@mydomain.com" password="xxxxxx"

What currently i am doing is,

There will be some files in a server for example

\\storageserver\project\Rajkumar\file1.xls

The above is the file in the server, if i wants to access or open the file while clicking a button in the web application,

i have to mention a username and password of those who have rights to access the file in the location unless and otherwise no one can not access the file through the web application.

Now i wants to know whether any other way to access the file without using user name and password in identity impersonate tag.


Thanks in advance.
Posted
Comments
joshrduncan2012 12-Jul-13 9:47am    
Please do not display your email address anywhere on here unless you are wanting to invite spam to your email. When you get a comment from a fellow CP user, you'll get an email automatically.
Sergey Alexandrovich Kryukov 12-Jul-13 10:05am    
If you don't have a control over the site using ASP.NET, you can access the file if it is provided without identification and you cannot if it is not provided this way. I don't know what could be discussed here. Imaging you are writing your site or a Web service. Would you leave a back door? :-)
—SA

1 solution

Either you use the identity tag in web.config or you grant permissions to the account running the application pool in IIS. Or you can impersonate each user (essentially running as Windows authentication) and then grant each user individually but I think using the app pool account is much easier.

Of course, you could always grant the EVERYONE account permissions but I would not recommend that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900