Home All Groups Group Topic Archive Search About

Web App Impersonation

Author
11 Jul 2006 11:25 PM
David
Ok, so it's not as simple or straightforward as it sounds, but here's
what I'm trying to do:

I have a web app where the user context is, by default, determined by
the user logged on to the machine at the time. (simple)  However, we
would like to add the ability for another user to log into the web app,
such that the web app now thinks that it's the new person. Basically,
the User.Identity.Name first reads as 'mydomain\myuser' and after the
login, it reads as 'mydomain\newuser.'  This is important, as much of
the user's experience weighs on the built-in functionality/stored
values of the .NET 2.0 Profile object.

I've tried several things and the closest I can get is using the method
outlined here:
http://msdn2.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext.aspx
This method will change the context of the .NET process running on the
server.  I'm convinced that I can use the 'LogonUser()' function to
determine if the credentials are correct, but I need the web context to
be changed, not the Windows context.

I've been puzzling over this task for a while, and maybe a fresh set of
eyes could help.

Thanks.

Author
12 Jul 2006 1:23 AM
Joe Kaplan (MVP - ADSI)
Couldn't you just change the IE settings temporarily so that IWA auth always
prompts for credentials?  That is by far the easiest solution I can think
of.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Show quoteHide quote
"David" <ddhat***@gmail.com> wrote in message
news:1152660359.448781.173380@p79g2000cwp.googlegroups.com...
> Ok, so it's not as simple or straightforward as it sounds, but here's
> what I'm trying to do:
>
> I have a web app where the user context is, by default, determined by
> the user logged on to the machine at the time. (simple)  However, we
> would like to add the ability for another user to log into the web app,
> such that the web app now thinks that it's the new person. Basically,
> the User.Identity.Name first reads as 'mydomain\myuser' and after the
> login, it reads as 'mydomain\newuser.'  This is important, as much of
> the user's experience weighs on the built-in functionality/stored
> values of the .NET 2.0 Profile object.
>
> I've tried several things and the closest I can get is using the method
> outlined here:
> http://msdn2.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext.aspx
> This method will change the context of the .NET process running on the
> server.  I'm convinced that I can use the 'LogonUser()' function to
> determine if the credentials are correct, but I need the web context to
> be changed, not the Windows context.
>
> I've been puzzling over this task for a while, and maybe a fresh set of
> eyes could help.
>
> Thanks.
>