Ask a Question related to ASP.NET Web Services, Design and Development.
-
CBran #1
Impersonation failing when accessing another assembly
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
CBran Guest
-
Assembly acessing StrongNamed assembly getting "Access Denied" intermitently
I have an ASP.NET application that is using a code library our development team uses. The code library is a few web controls in a Strong Named... -
Impersonation fails when accessing remote files.
I am impersonating a user by setting the details in Web.config. I have confirmed that the .aspx page is running as the impersonated user. I then... -
Reading the public key inside a strongly signed assembly from the assembly itself???
Hello, is it possible to programmatically read (and how) the public key that is embedded into an assembly that has been strongly signed??? What... -
assembly directory
I need to add an additional directory to search for assemblies other than the "bin" directory.... how do I do this in the web.config file? -
GAC assembly with ASP.NET
There's no need to put your Class Library in the GAC, give it a strong name, etc., BTW. You can just put a copy of the DLL in the /bin folder of... -
Dilip Krishnan #2
Re: Impersonation failing when accessing another assembly
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
[url]http://www.geniant.com[/url]
> 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
Dilip Krishnan Guest
-
CBran #3
Re: Impersonation failing when accessing another assembly
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
CBran Guest
-
Dilip Krishnan #4
Re: Impersonation failing when accessing another assembly
Hello CBran,
You would need to set the impersonate in web.config to true and use the
the Credentials property on the client and set it to an appropriate credential
that has permissions
[0] - [url]http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaspnetimpersonation.asp[/url]
[1] - [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wse/html/1a633f76-5173-40d8-8dfb-5fdba063e6e8.asp[/url]
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
[url]http://www.geniant.com[/url]
> 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
Dilip Krishnan Guest



Reply With Quote

