Click here to Skip to main content
16,021,621 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My asp.net web application is using windows authentication & running under impersonation account "AppServiceAccount" which has access to certain folders for IO operations.

Certain pages require IO operations on some privileged folders on which client does not allow "AppServiceAccount" to have access. Instead we had to use user account who is logged in to access the required folder.

We did this by creating a subfolder in our web application hierarchy and placing all such pages along with a separate web.config in that folder. In this web.config we enabled Impersonation with <deny users="?" />. Now all pages in this folder run under user account instead of "AppServiceAccount".

We tested for IO operations on normal shared folders (on which only the logged in user had privileges) and it worked fine. But in production environment we need to do IO operations on DFS shared folders. The path is like - \\london.companyname.com\dfs\Dev\Share

The issue is that Directory.Exists("\\london.companyname.com\\dfs\Dev\Share") returns false for this path although the logged in user has full access to it. Even if we try to copy a file directly to this path without checking it gives error "Access to the path \\london.companyname.com\\dfs\Dev\Share\Test.pdf is denied.

As it is working fine for normal windows share folders, I have a feeling this is a problem with accessing DFS shares while using impersonation. Please advise.
Posted
Updated 26-Oct-20 20:04pm
v4

1 solution

did you get any solution. We are also facing similar problem.
 
Share this answer
 
Comments
CHill60 27-Oct-20 7:13am    
Please do not post comments or questions as a solution to an old post - use the Have a Question or Comment link next to it.
Member 12277546 19-Nov-20 4:40am    
Did you find any solution? We are facing exact same problem.

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