Impersonation - using Impersonate with NewCredentials

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frankiefrank
    New Member
    • Jan 2008
    • 15

    Impersonation - using Impersonate with NewCredentials

    Hello,

    I'm trying to implement impersonation.

    When I use LogonUser with LogonSessionTyp e.Network I get a token which I pass into the WindowsIdentity constructor. That seems to work - I get an identity with the expected name.

    However, when I use LogonSessionTyp e.NewCredential s and afterwards do DuplicateToken (to get the SecurityImperso nation token)
    the WindowsIdentity object I create seems to still be my own identity.

    Impersonate on that identity doesn't change the current WindowsIdentity .

    Is there something I'm missing?

    thanks,
    Frankie
Working...