D
davidalan
I have a .NET 2.0 web app that needs to access the file server.
Obviously, the local ASPNET account on the web server does not have
any permissions on the file server. Therefore, I turned on
impersonation in the web.config for the web app.
However, when running on the dev web server, setting Identity
impersonation="true" in the web.config file leaves me with an "access
to the path '\\server\share' is denied" exception. Setting up
impersonation programatically results in the same. But, if I run the
app off my local box, which is using the VS 2005 built in web server,
it works like a charm. It also works great if I hardcode a username
and password in the web.config file.
Impersonation appears to be working fine on the web dev box but not on
the file server. The security event log on the file server shows NT
AUTHORITY\ANONYMOUS LOGON as the user when running the app from the
dev box. When running it on my local box, my username shows up as
expected.
I have Integrated Windows authentication enabled in IIS and anonymous
access is not checked.
(http://forums.iis.net/t/1114220.aspx), (http://forums.asp.net/p/
716850/716850.aspx), and (http://msdn2.microsoft.com/en-us/library/
Aa291350(VS.71).aspx) all explain what's going on. The user is being
impersonated on the web server box as expected, but the user's
credentials aren't being passed on to the file server. Instead the web
app is accessing the file server as anonymous.
How can I get around this? Any help would be appreciated!
Obviously, the local ASPNET account on the web server does not have
any permissions on the file server. Therefore, I turned on
impersonation in the web.config for the web app.
However, when running on the dev web server, setting Identity
impersonation="true" in the web.config file leaves me with an "access
to the path '\\server\share' is denied" exception. Setting up
impersonation programatically results in the same. But, if I run the
app off my local box, which is using the VS 2005 built in web server,
it works like a charm. It also works great if I hardcode a username
and password in the web.config file.
Impersonation appears to be working fine on the web dev box but not on
the file server. The security event log on the file server shows NT
AUTHORITY\ANONYMOUS LOGON as the user when running the app from the
dev box. When running it on my local box, my username shows up as
expected.
I have Integrated Windows authentication enabled in IIS and anonymous
access is not checked.
(http://forums.iis.net/t/1114220.aspx), (http://forums.asp.net/p/
716850/716850.aspx), and (http://msdn2.microsoft.com/en-us/library/
Aa291350(VS.71).aspx) all explain what's going on. The user is being
impersonated on the web server box as expected, but the user's
credentials aren't being passed on to the file server. Instead the web
app is accessing the file server as anonymous.
How can I get around this? Any help would be appreciated!