Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2007

Tip: Looking for answers? Try searching our database.

Error: Invalid token for impersonation - it cannot be duplicated

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chavdar - 13 Oct 2007 00:49 GMT
We randomly get an error "System.ArgumentException: Invalid token for
impersonation - it cannot be duplicated" when executing

IntPtr logonToken= WindowsIdentity.GetCurrent().Token;            

WindowsIdentity windowsIdentity = new WindowsIdentity(logonToken);
Vadym Stetsiak - 22 Oct 2007 22:25 GMT
Hello, Chavdar!

Do you get this for different users? What is there in the Security Audit
event log?
--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote  on Fri, 12 Oct 2007 16:49:01 -0700:

C> We randomly get an error "System.ArgumentException: Invalid token for
C> impersonation - it cannot be duplicated" when executing

C> IntPtr logonToken= WindowsIdentity.GetCurrent().Token;

C> WindowsIdentity windowsIdentity = new WindowsIdentity(logonToken);
Chavdar - 23 Oct 2007 18:21 GMT
Hi,

We get this for some users and not others. We tracked it down to the
following:

Our programs are .NET 2.0. The computers exibiting the issue had .NET 2.0
AND .NET 3.0 installed. After we uninstalled .NET 3.0 the problem went away.

This to be is a bug somewhere in the framework - not sure where....2.0 or 3.0.

Please help.

Thanks

> Hello, Chavdar!
>
[quoted text clipped - 12 lines]
>
>  C> WindowsIdentity windowsIdentity = new WindowsIdentity(logonToken);
Vadym Stetsiak - 23 Oct 2007 21:58 GMT
Hello, Chavdar!

When creating WindowsIdentity object token passed to the constructor is
duplicated.
However, to do this as far as I remember special privileges are needed.

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote  on Tue, 23 Oct 2007 10:21:12 -0700:

C> Hi,

C> We get this for some users and not others. We tracked it down to the
C> following:

C> Our programs are .NET 2.0. The computers exibiting the issue had .NET
C> 2.0
C> AND .NET 3.0 installed. After we uninstalled .NET 3.0 the problem
C> went away.

C> This to be is a bug somewhere in the framework - not sure
C> where....2.0 or 3.0.

C> Please help.

C> Thanks

C> "Vadym Stetsiak" wrote:

>> Hello, Chavdar!

>> Do you get this for different users? What is there in the Security
>> Audit  event log?
>> --
>> With best regards, Vadym Stetsiak.
>> Blog: http://vadmyst.blogspot.com

>> You wrote  on Fri, 12 Oct 2007 16:49:01 -0700:

C>>> We randomly get an error "System.ArgumentException: Invalid token
C>>> for impersonation - it cannot be duplicated" when executing

C>>> IntPtr logonToken= WindowsIdentity.GetCurrent().Token;

C>>> WindowsIdentity windowsIdentity = new WindowsIdentity(logonToken);
Chavdar - 23 Oct 2007 22:17 GMT
Hi Vadym,

1. Who/what duplicates the token?
2. Why does this work under .NET 2.0 and blows up sporadically under .NET 3.0?

Thanks in advance.

> Hello, Chavdar!
>
[quoted text clipped - 43 lines]
>
>  C>>> WindowsIdentity windowsIdentity = new WindowsIdentity(logonToken);

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.