Impersonation failing when accessing another assembly

C

CBran

Hi, I've written an ASP.NET web service which impersonates a user
designated by the end user, then calls into another .NET assembly
to copy a file from a network share to a local drive. The assembly
throws the exception "Could not find file [unc path]." I added
code to determine the current identity as follows:

WindowsIdentity.GetCurrent().Name

This code returns [Domain name]\ASPNET, which tells me the code is
not running under the impersonated account, but the ASPNET account.

I even tried adding code to impersonate the same account within the
assembly in question, but the results are the same - the code insists
on running under the ASPNET account.

I can't seem to find anyone else having similar issues, but then I
cant't find documentation that indicates I should be able to do this
either.

This is on a Windows Server 2003 machine.

Can anyone confirm that an assembly called from an ASP.NET application
using impersonation will also run using the impersonated account?

I'm convinced it's a configuration issue, but can't seem to find a fix.
Thanks,
Chris
 
D

Dilip Krishnan

Hello CBran,
Im assuming youve set impersonate to true. Are you setting the client credentials
in the client application to the desired user?

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
 
C

CBran

Dilip,

Thanks for the reply. If you are asking if we are setting impersonate
to true in the web.config file, then NO, we are not.
We are impersonating entirely through code. When you say "client
credentials" I think you are referring to the CredentialCache.
We are not utilizing the CredentialCache at all.

Thanks again,
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top