How can I impersonate a user in code?
- From: "Friso Wiskerke" <friso@xxxxxxxxxxxxx>
- Date: Wed, 15 Feb 2006 10:33:21 +0100
Hi all,
I'm trying to save an uploaded file to a share on another computer in the
domain. If I use the <identity impersonate ..... /> tag in the web.config
and enter the credentials of a domain user which has sufficient rights on
that share it works fine.
However I don't need (and want) to run the complete site under this user, I
only need to impersonate the moment I'm trying to save the file. I've tried
to achieve this is code by creating a WindowsIdentity object and
impersonating it but that isn't working (NotSupported Exception). The code
works fine in a sample winapp but apparantly a webapp doesn't like it.
Does anyone have an idea on how I can achieve the impersonation in code?
TIA,
Friso Wiskerke
.
- Follow-Ups:
- Re: How can I impersonate a user in code?
- From: MikeS
- Re: How can I impersonate a user in code?
- Prev by Date: Re: Problem running ASP.NET 2.0 on Win2K domain controller
- Next by Date: Re: Cannot open log Application on machine
- Previous by thread: moving encryption keycontainers
- Next by thread: Re: How can I impersonate a user in code?
- Index(es):
Relevant Pages
|
|