Re: Impersonation a user for the duration of a method.
- From: "Henning Krause [MVP]" <newsgroups.remove@xxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 20:12:11 +0100
Hello,
and which version of the Framework are you using? Which Windows version?
Greetings,
Henning Krause
"Narendra" <Narendra@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:79D40D7D-CDB1-48B2-A516-1F368260E7E5@xxxxxxxxxxxxxxxx
> Hi!
> I think more clarity is required from your side. Why do you want to do
> impersonation for only one method? If I am not wrong, you want to
> impersonate. But which user you want to impersonate?
>
>
>
> regards,
> narendra.
>
> "Rainier [MCT]" wrote:
>
>> Hi,
>> I'm running a ASP.NET application using the anonimous user. (ASPNET)
>> I don't want the user to log in and I don't want to give any more rights
>> to
>> the ASPNET user either. So I thought of impersonating a local user just
>> for
>> the duration of a single method.
>>
>> That user will access the local SAM and retrieve some info.
>>
>> I've found code on the internet which shows me how to login using COM
>> calls
>> releasing the handles and dublicating tokens. Yuck.
>> [DllImport("advapi32.dll", SetLastError=true)]
>> public static extern bool LogonUser(string pszUsername, string pszDomain,
>> string pszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr
>> phToken);
>>
>> Isn't there some other dot.net like way to do this ?
>> Something like an attribute with a username and a password I can set
>> above
>> my method?
>>
>> Hope someone can release me of this COM code quick.
>>
>> Kind Regards,
>> --
>> Rainier van Slingerlandt
>> (Freelance trainer/consultant/developer)
>> www.slingerlandt.com
.
- Prev by Date: Re: log on to one, log on to all - web apps
- Next by Date: Re: HOWTO: Prevent Dynamic Loading of internal Types
- Previous by thread: Re: Impersonation a user for the duration of a method.
- Next by thread: Problems deploying security policy via .msi
- Index(es):
Relevant Pages
|