.NETGURU
Impersonation - uggrr
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngsec' list.


Carlos Magalhaes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2652.35">
<TITLE> Impersonation - uggrr</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi ,</FONT>
</P>

<P><FONT SIZE=3D2>Ambrose gave me some impersonation control I have =
allowed my MACHINENAME\ASPNET to run as part of OS but  I keep =
receiving :</FONT></P>

<P><FONT SIZE=3D2>System.Exception: LogonUser; GetLastError Return =
Code: 1326</FONT>
</P>

<P><FONT SIZE=3D2>Why and what is it?</FONT>
</P>

<P><FONT SIZE=3D2>Thanks</FONT>
</P>

<P><FONT SIZE=3D2>Carlos</FONT>
</P>

</BODY>
</HTML>

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

Reply to this message...
 
    
TIM ELLISON
Interesting. My domain account is also a local machine admin and I've set
impersonation to true using my domain account and receive the same error.
If you look at your event log, you'll see

"Ci" as the source or "CiDaemon" with the exact same error code [1326].
I'll post more as we work through this. We have custom event logging to
implement and that absolutely requires registry access but we do not permit
ASPNET to run as an Admin in production so method-scope impersonation will
be required.

Regards,

Tim Ellison
Senior Web Applications Developer,
Long and Foster Real Estate
703-359-1884
Click here to reveal e-mail address <mailto:Click here to reveal e-mail address>

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Monday, May 27, 2002 6:34 AM
To: aspngsec
Subject: [aspngsec] Impersonation - uggrr

Hi ,
Ambrose gave me some impersonation control I have allowed my
MACHINENAME\ASPNET to run as part of OS but I keep receiving :
System.Exception: LogonUser; GetLastError Return Code: 1326
Why and what is it?
Thanks
Carlos
| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
------------------------------------------------------------- This email and
any files transmitted are confidential and intended solely for the use of
the individual or entity to which they are addressed, whose privacy should
be respected. Any views or opinions are solely those of the author and do
not necessarily represent those of the Trencor Group, or any of its
representatives, unless specifically stated. Email transmission cannot be
guaranteed to be secure, error free or without virus contamination. The
sender therefore accepts no liability for any errors or omissions in the
contents of this message, nor for any virus infection that might result from
opening this message. Trencor is not responsible in the event of any third
party interception of this email. If you have received this email in error
please notify Click here to reveal e-mail address For more information about Trencor,
visit www.trencor.net
Reply to this message...
 
    
Little, Ambrose
Carlos,

Judging from your personal message to me, I take it you've figured out what
you were doing wrong. Or are you still getting this error?

BTW, I've got a working C# version of the impersonation stuff available now
if anyone's interested:
<http://code.clanlittle.org/ShowCode.aspx?name=BOKF.Security.Impersonate.CS>

--Ambrose

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Monday, 27 May, 2002 05:34
To: aspngsec
Subject: [aspngsec] Impersonation - uggrr

Hi ,
Ambrose gave me some impersonation control I have allowed my
MACHINENAME\ASPNET to run as part of OS but I keep receiving :
System.Exception: LogonUser; GetLastError Return Code: 1326
Why and what is it?
Thanks
Carlos
| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
------------------------------------------------------------- This email and
any files transmitted are confidential and intended solely for the use of
the individual or entity to which they are addressed, whose privacy should
be respected. Any views or opinions are solely those of the author and do
not necessarily represent those of the Trencor Group, or any of its
representatives, unless specifically stated. Email transmission cannot be
guaranteed to be secure, error free or without virus contamination. The
sender therefore accepts no liability for any errors or omissions in the
contents of this message, nor for any virus infection that might result from
opening this message. Trencor is not responsible in the event of any third
party interception of this email. If you have received this email in error
please notify Click here to reveal e-mail address For more information about Trencor,
visit www.trencor.net

******************************************************************************
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
*******************************************************************************

Reply to this message...
 
    
Carlos Magalhaes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2652.35">
<TITLE>RE: [aspngsec] RE: Impersonation - uggrr</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi Mr. A</FONT>
</P>

<P><FONT SIZE=3D2>Yeah I got it to work the old finger trouble nothing =
wrong with the (brilliant) code.</FONT>
</P>

<P><FONT SIZE=3D2>I was using USENAME DOMAIN PASSWORD in the Beginim... =
instead of USERNAME PASSWORD DOMAIN.</FONT>
</P>

<P><FONT SIZE=3D2>That's why I was receiving an error 1326 which means =
Unknown Username or Bad Password.</FONT>
</P>

<P><FONT SIZE=3D2>The app works fine now and I have no problem. What I =
am trying to find out though is how I can store the USERNAME PASSWORD =
DOMAIN in the registry just for security reasons.</FONT></P>

<P><FONT SIZE=3D2>Thank you Mr. A it helped a lot!</FONT>
<BR><FONT SIZE=3D2>You wouldn't have a tut that explains what you did =
and why....</FONT>
</P>

<P><FONT SIZE=3D2>Carlos</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Little, Ambrose [<A =
HREF=3D"mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</A>] =
</FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, May 29, 2002 5:20 PM</FONT>
<BR><FONT SIZE=3D2>To: aspngsec</FONT>
<BR><FONT SIZE=3D2>Subject: [aspngsec] RE: Impersonation - uggrr</FONT>
</P>

<P><FONT SIZE=3D2>Carlos,</FONT>
</P>

<P><FONT SIZE=3D2>Judging from your personal message to me, I take it =
you've figured out what</FONT>
<BR><FONT SIZE=3D2>you were doing wrong.  Or are you still getting =
this error?</FONT>
</P>

<P><FONT SIZE=3D2>BTW, I've got a working C# version of the =
impersonation stuff available now</FONT>
<BR><FONT SIZE=3D2>if anyone's interested:</FONT>
<BR><FONT SIZE=3D2><<A =
HREF=3D"http://code.clanlittle.org/ShowCode.aspx?name=3DBOKF.Security.Im=
personate.CS" =
TARGET=3D"_blank">http://code.clanlittle.org/ShowCode.aspx?name=3DBOKF.S=
ecurity.Impersonate.CS</A>></FONT>
</P>

<P><FONT SIZE=3D2>--Ambrose</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Carlos Magalhaes [<A =
HREF=3D"mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</A>] =
</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, 27 May, 2002 05:34</FONT>
<BR><FONT SIZE=3D2>To: aspngsec</FONT>
<BR><FONT SIZE=3D2>Subject: [aspngsec] Impersonation - uggrr</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Hi , </FONT>
<BR><FONT SIZE=3D2>Ambrose gave me some impersonation control I have =
allowed my</FONT>
<BR><FONT SIZE=3D2>MACHINENAME\ASPNET to run as part of OS but  I =
keep receiving :</FONT>
<BR><FONT SIZE=3D2>System.Exception: LogonUser; GetLastError Return =
Code: 1326 </FONT>
<BR><FONT SIZE=3D2>Why and what is it? </FONT>
<BR><FONT SIZE=3D2>Thanks </FONT>
<BR><FONT SIZE=3D2>Carlos </FONT>
<BR><FONT SIZE=3D2>| [aspngsec] member Click here to reveal e-mail address =3D YOUR =
ID</FONT>
<BR><FONT SIZE=3D2>| <A =
HREF=3D"http://www.asplists.com/asplists/aspngsec.asp" =
TARGET=3D"_blank">http://www.asplists.com/asplists/aspngsec.asp</A> =3D =
JOIN/QUIT</FONT>
<BR><FONT SIZE=3D2>| <A HREF=3D"http://www.asplists.com/search"" target="_blank">http://www.asplists.com/search"; =
TARGET=3D"_blank">http://www.asplists.com/search</A> =3D SEARCH =
Archives</FONT>
<BR><FONT =
SIZE=3D2>------------------------------------------------------------- =
This email and</FONT>
<BR><FONT SIZE=3D2>any files transmitted are confidential and intended =
solely for the use of</FONT>
<BR><FONT SIZE=3D2>the individual or entity to which they are =
addressed, whose privacy should</FONT>
<BR><FONT SIZE=3D2>be respected. Any views or opinions are solely those =
of the author and do</FONT>
<BR><FONT SIZE=3D2>not necessarily represent those of the Trencor =
Group, or any of its</FONT>
<BR><FONT SIZE=3D2>representatives, unless specifically stated. Email =
transmission cannot be</FONT>
<BR><FONT SIZE=3D2>guaranteed to be secure, error free or without virus =
contamination. The</FONT>
<BR><FONT SIZE=3D2>sender therefore accepts no liability for any errors =
or omissions in the</FONT>
<BR><FONT SIZE=3D2>contents of this message, nor for any virus =
infection that might result from</FONT>
<BR><FONT SIZE=3D2>opening this message. Trencor is not responsible in =
the event of any third</FONT>
<BR><FONT SIZE=3D2>party interception of this email. If you have =
received this email in error</FONT>
<BR><FONT SIZE=3D2>please notify Click here to reveal e-mail address For more =
information about Trencor,</FONT>
<BR><FONT SIZE=3D2>visit www.trencor.net </FONT>
</P>
<BR>

<P><FONT =
SIZE=3D2>***************************************************************=
***************</FONT>
<BR><FONT SIZE=3D2>The Company reserves the right to amend =
statements</FONT>
<BR><FONT SIZE=3D2>made herein in the event of a mistake.  Unless =
expressly</FONT>
<BR><FONT SIZE=3D2>stated herein to the contrary, only agreements in =
writing signed</FONT>
<BR><FONT SIZE=3D2>by an authorized officer of the Company may be =
enforced against it.</FONT>
<BR><FONT =
SIZE=3D2>***************************************************************=
****************</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>| [aspngsec] member Click here to reveal e-mail address =3D YOUR =
ID</FONT>
<BR><FONT SIZE=3D2>| <A =
HREF=3D"http://www.asplists.com/asplists/aspngsec.asp" =
TARGET=3D"_blank">http://www.asplists.com/asplists/aspngsec.asp</A> =3D =
JOIN/QUIT</FONT>
<BR><FONT SIZE=3D2>| <A HREF=3D"http://www.asplists.com/search"" target="_blank">http://www.asplists.com/search"; =
TARGET=3D"_blank">http://www.asplists.com/search</A> =3D SEARCH =
Archives</FONT>
</P>

</BODY>
</HTML>

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

Reply to this message...
 
    
Little, Ambrose
Sure, Carlos,

I was originally directed to the WindowsIdentity class by a coworker who was
trying to get programmatic impersonation to work for access to a share. I
started researching it and found that others had run into the same problem,
and it was suggested to me by someone (can't remember whom) to try just
using all API calls instead of the WI class. So I looked up the related API
calls and played with them until I got it all to work.

The reason we werre looking for it was that we were exploring options for
accessing network shares. We ended up going with a different solution (I'm
not at liberty to discuss it) that fits our needs better, though we now have
this programmatic impersonation available should we choose to use it for
things that don't fit our solution.

--Ambrose

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Thursday, 30 May, 2002 02:20
To: aspngsec
Subject: [aspngsec] RE: Impersonation - uggrr

Hi Mr. A

Yeah I got it to work the old finger trouble nothing wrong with the
(brilliant) code.

I was using USENAME DOMAIN PASSWORD in the Beginim... instead of USERNAME
PASSWORD DOMAIN.

That's why I was receiving an error 1326 which means Unknown Username or Bad
Password.

The app works fine now and I have no problem. What I am trying to find out
though is how I can store the USERNAME PASSWORD DOMAIN in the registry just
for security reasons.

Thank you Mr. A it helped a lot!
You wouldn't have a tut that explains what you did and why....

Carlos

-----Original Message-----
From: Little, Ambrose [mailto:Click here to reveal e-mail address
<mailto:Click here to reveal e-mail address> ]
Sent: Wednesday, May 29, 2002 5:20 PM
To: aspngsec
Subject: [aspngsec] RE: Impersonation - uggrr

Carlos,

Judging from your personal message to me, I take it you've figured out what
you were doing wrong. Or are you still getting this error?

BTW, I've got a working C# version of the impersonation stuff available now
if anyone's interested:
<http://code.clanlittle.org/ShowCode.aspx?name=BOKF.Security.Impersonate.CS
<http://code.clanlittle.org/ShowCode.aspx?name=BOKF.Security.Impersonate.CS>
>

--Ambrose

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address
<mailto:Click here to reveal e-mail address> ]
Sent: Monday, 27 May, 2002 05:34
To: aspngsec
Subject: [aspngsec] Impersonation - uggrr

Hi ,
Ambrose gave me some impersonation control I have allowed my
MACHINENAME\ASPNET to run as part of OS but I keep receiving :
System.Exception: LogonUser; GetLastError Return Code: 1326
Why and what is it?
Thanks
Carlos
| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp
<http://www.asplists.com/asplists/aspngsec.asp> = JOIN/QUIT
| http://www.asplists.com/search <http://www.asplists.com/search> = SEARCH
Archives
------------------------------------------------------------- This email and

any files transmitted are confidential and intended solely for the use of
the individual or entity to which they are addressed, whose privacy should
be respected. Any views or opinions are solely those of the author and do
not necessarily represent those of the Trencor Group, or any of its
representatives, unless specifically stated. Email transmission cannot be
guaranteed to be secure, error free or without virus contamination. The
sender therefore accepts no liability for any errors or omissions in the
contents of this message, nor for any virus infection that might result from

opening this message. Trencor is not responsible in the event of any third
party interception of this email. If you have received this email in error
please notify Click here to reveal e-mail address For more information about Trencor,
visit www.trencor.net

****************************************************************************
**
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
****************************************************************************
***

| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp
<http://www.asplists.com/asplists/aspngsec.asp> = JOIN/QUIT
| http://www.asplists.com/search <http://www.asplists.com/search> = SEARCH
Archives

| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
------------------------------------------------------------- This email and
any files transmitted are confidential and intended solely for the use of
the individual or entity to which they are addressed, whose privacy should
be respected. Any views or opinions are solely those of the author and do
not necessarily represent those of the Trencor Group, or any of its
representatives, unless specifically stated. Email transmission cannot be
guaranteed to be secure, error free or without virus contamination. The
sender therefore accepts no liability for any errors or omissions in the
contents of this message, nor for any virus infection that might result from
opening this message. Trencor is not responsible in the event of any third
party interception of this email. If you have received this email in error
please notify Click here to reveal e-mail address For more information about Trencor,
visit www.trencor.net

******************************************************************************
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
*******************************************************************************
Reply to this message...
 
    
Emil Christopher Melar
Were you able to KEEP the new windows identity across different pages?
Like persisting it in session like HTTP NTCR?

-
Emil Chr. Melar

-----Original Message-----
From: Little, Ambrose [mailto:Click here to reveal e-mail address]
Sent: 30. mai 2002 16:20
To: aspngsec
Subject: [aspngsec] RE: Impersonation - uggrr

Sure, Carlos,

I was originally directed to the WindowsIdentity class by a coworker who
was trying to get programmatic impersonation to work for access to a
share. I started researching it and found that others had run into the
same problem, and it was suggested to me by someone (can't remember
whom) to try just using all API calls instead of the WI class. So I
looked up the related API calls and played with them until I got it all
to work.

The reason we werre looking for it was that we were exploring options
for accessing network shares. We ended up going with a different
solution (I'm not at liberty to discuss it) that fits our needs better,
though we now have this programmatic impersonation available should we
choose to use it for things that don't fit our solution.

--Ambrose

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Thursday, 30 May, 2002 02:20
To: aspngsec
Subject: [aspngsec] RE: Impersonation - uggrr

Hi Mr. A

Yeah I got it to work the old finger trouble nothing wrong with the
(brilliant) code.

I was using USENAME DOMAIN PASSWORD in the Beginim... instead of
USERNAME PASSWORD DOMAIN.

That's why I was receiving an error 1326 which means Unknown Username or
Bad Password.

The app works fine now and I have no problem. What I am trying to find
out though is how I can store the USERNAME PASSWORD DOMAIN in the
registry just for security reasons.

Thank you Mr. A it helped a lot!
You wouldn't have a tut that explains what you did and why....

Carlos

-----Original Message-----
From: Little, Ambrose [mailto:Click here to reveal e-mail address]
Sent: Wednesday, May 29, 2002 5:20 PM
To: aspngsec
Subject: [aspngsec] RE: Impersonation - uggrr

Carlos,

Judging from your personal message to me, I take it you've figured out
what
you were doing wrong. Or are you still getting this error?

BTW, I've got a working C# version of the impersonation stuff available
now
if anyone's interested:
<http://code.clanlittle.org/ShowCode.aspx?name=BOKF.Security.Impersonate
.CS>

--Ambrose

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Monday, 27 May, 2002 05:34
To: aspngsec
Subject: [aspngsec] Impersonation - uggrr

Hi ,
Ambrose gave me some impersonation control I have allowed my
MACHINENAME\ASPNET to run as part of OS but I keep receiving :
System.Exception: LogonUser; GetLastError Return Code: 1326
Why and what is it?
Thanks
Carlos
| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
------------------------------------------------------------- This email
and
any files transmitted are confidential and intended solely for the use
of
the individual or entity to which they are addressed, whose privacy
should
be respected. Any views or opinions are solely those of the author and
do
not necessarily represent those of the Trencor Group, or any of its
representatives, unless specifically stated. Email transmission cannot
be
guaranteed to be secure, error free or without virus contamination. The
sender therefore accepts no liability for any errors or omissions in the

contents of this message, nor for any virus infection that might result
from
opening this message. Trencor is not responsible in the event of any
third
party interception of this email. If you have received this email in
error
please notify Click here to reveal e-mail address For more information about Trencor,

visit www.trencor.net

************************************************************************
******
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
************************************************************************
*******

| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
------------------------------------------------------------- This email
and any files transmitted are confidential and intended solely for the
use of the individual or entity to which they are addressed, whose
privacy should be respected. Any views or opinions are solely those of
the author and do not necessarily represent those of the Trencor Group,
or any of its representatives, unless specifically stated. Email
transmission cannot be guaranteed to be secure, error free or without
virus contamination. The sender therefore accepts no liability for any
errors or omissions in the contents of this message, nor for any virus
infection that might result from opening this message. Trencor is not
responsible in the event of any third party interception of this email.
If you have received this email in error please notify
Click here to reveal e-mail address For more information about Trencor, visit
www.trencor.net

************************************************************************
******
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
************************************************************************
*******
| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
Reply to this message...
 
    
Little, Ambrose
Theoretically, I don't think it would be possible to use this method and
persist it through multiple requests, but I haven't really looked into it.
I personally can't think of a situation where I'd want to that I couldn't
just do on every request. It might be a little better on performance if I
could, but I don't think it'd be significant. I'd probably go with
impersonation at the application level, though.

--Ambrose

-----Original Message-----
From: Emil Christopher Melar [mailto:Click here to reveal e-mail address]
Sent: Thursday, 30 May, 2002 17:47
To: aspngsec
Subject: [aspngsec] RE: Impersonation - uggrr

Were you able to KEEP the new windows identity across different pages? Like
persisting it in session like HTTP NTCR?

-
Emil Chr. Melar

-----Original Message-----
From: Little, Ambrose [mailto:Click here to reveal e-mail address]
Sent: 30. mai 2002 16:20
To: aspngsec
Subject: [aspngsec] RE: Impersonation - uggrr

Sure, Carlos,

I was originally directed to the WindowsIdentity class by a coworker who was
trying to get programmatic impersonation to work for access to a share. I
started researching it and found that others had run into the same problem,
and it was suggested to me by someone (can't remember whom) to try just
using all API calls instead of the WI class. So I looked up the related API
calls and played with them until I got it all to work.

The reason we werre looking for it was that we were exploring options for
accessing network shares. We ended up going with a different solution (I'm
not at liberty to discuss it) that fits our needs better, though we now have
this programmatic impersonation available should we choose to use it for
things that don't fit our solution.

--Ambrose

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Thursday, 30 May, 2002 02:20
To: aspngsec
Subject: [aspngsec] RE: Impersonation - uggrr

Hi Mr. A

Yeah I got it to work the old finger trouble nothing wrong with the
(brilliant) code.

I was using USENAME DOMAIN PASSWORD in the Beginim... instead of USERNAME
PASSWORD DOMAIN.

That's why I was receiving an error 1326 which means Unknown Username or Bad
Password.

The app works fine now and I have no problem. What I am trying to find out
though is how I can store the USERNAME PASSWORD DOMAIN in the registry just
for security reasons.

Thank you Mr. A it helped a lot!
You wouldn't have a tut that explains what you did and why....

Carlos

-----Original Message-----
From: Little, Ambrose [mailto:Click here to reveal e-mail address
<mailto:Click here to reveal e-mail address> ]
Sent: Wednesday, May 29, 2002 5:20 PM
To: aspngsec
Subject: [aspngsec] RE: Impersonation - uggrr

Carlos,

Judging from your personal message to me, I take it you've figured out what
you were doing wrong. Or are you still getting this error?

BTW, I've got a working C# version of the impersonation stuff available now
if anyone's interested:
<http://code.clanlittle.org/ShowCode.aspx?name=BOKF.Security.Impersonate.CS
<http://code.clanlittle.org/ShowCode.aspx?name=BOKF.Security.Impersonate.CS>
>

--Ambrose

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address
<mailto:Click here to reveal e-mail address> ]
Sent: Monday, 27 May, 2002 05:34
To: aspngsec
Subject: [aspngsec] Impersonation - uggrr

Hi ,
Ambrose gave me some impersonation control I have allowed my
MACHINENAME\ASPNET to run as part of OS but I keep receiving :
System.Exception: LogonUser; GetLastError Return Code: 1326
Why and what is it?
Thanks
Carlos
| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp
<http://www.asplists.com/asplists/aspngsec.asp> = JOIN/QUIT
| http://www.asplists.com/search <http://www.asplists.com/search> = SEARCH
Archives
------------------------------------------------------------- This email and

any files transmitted are confidential and intended solely for the use of
the individual or entity to which they are addressed, whose privacy should
be respected. Any views or opinions are solely those of the author and do
not necessarily represent those of the Trencor Group, or any of its
representatives, unless specifically stated. Email transmission cannot be
guaranteed to be secure, error free or without virus contamination. The
sender therefore accepts no liability for any errors or omissions in the
contents of this message, nor for any virus infection that might result from

opening this message. Trencor is not responsible in the event of any third
party interception of this email. If you have received this email in error
please notify Click here to reveal e-mail address For more information about Trencor,
visit www.trencor.net

****************************************************************************
**
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
****************************************************************************
***

| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp
<http://www.asplists.com/asplists/aspngsec.asp> = JOIN/QUIT
| http://www.asplists.com/search <http://www.asplists.com/search> = SEARCH
Archives

| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
------------------------------------------------------------- This email and
any files transmitted are confidential and intended solely for the use of
the individual or entity to which they are addressed, whose privacy should
be respected. Any views or opinions are solely those of the author and do
not necessarily represent those of the Trencor Group, or any of its
representatives, unless specifically stated. Email transmission cannot be
guaranteed to be secure, error free or without virus contamination. The
sender therefore accepts no liability for any errors or omissions in the
contents of this message, nor for any virus infection that might result from
opening this message. Trencor is not responsible in the event of any third
party interception of this email. If you have received this email in error
please notify Click here to reveal e-mail address For more information about Trencor,
visit www.trencor.net

****************************************************************************
**
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
****************************************************************************
***
| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngsec] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngsec.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

******************************************************************************
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
*******************************************************************************
Reply to this message...
 
 
System.Exception
System.Security.Principal.WindowsIdentity




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification