all groups > asp.net security > july 2006 >
You're in the

asp.net security

group:

Problems with impersonation



Problems with impersonation Vicente Flich
7/29/2006 6:55:01 AM
asp.net security: I have developing a web service that need to access files on Program Files
folder. I used write the tab <identity impersonate="true"/> in the web.config
file for the files outside the webservice folder can be accessed with a user
right correctly.

The problem is that if I use credentials of an user (of course with right to
acced to Program Files), the web service don't work, they report the next
exception:

System.InvalidOperationException: Error al generar el documento XML. --->
System.IO.FileLoadException: Acceso denegado: 'CarpinGestWS'.
Nombre de archivo: "CarpinGestWS"
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write12_ArrayOfStEmpresa(Object o)

If the I use an administrator user, the web service work fine. Finally, if a
try again with the user than firstly report the execption, then they work
fine!

Once I use the web service with an administrator acount, then all the users
can access the web service.

I think thes problem can be because any local security directive than not
permit an user load some DLL than the web service need, only administrators
can load it, and once an administrator load it, they can be accesed for the
users. But I don't know what directive is it, or what is the problem.

I have test my webservice on Xindows XP with IIS 5.1, also in Windows 2000
Server with IIS 5.0 and Server 2003 with IIS 6.0 and in three case i have the
same conclusion.

Anyone can help me?

RE: Problems with impersonation Vicente Flich
7/30/2006 12:02:01 AM

I reply me :-)

I just have fixed the problem. I find some other post in these newsgroup and
conclused the problem were that the user account that impersonate the ASP.NET
need full access to "C:\WINNT\Microsoft.NET\Framework\<version>\Temporary
ASP.NET Files folder" and others permisions and access rights (see complete
list in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/secnetht01.asp).

Thank to these great newsgroup I solve the problem.


AddThis Social Bookmark Button