0

I want my web service (using servicestack, if that matters) to be able to authenticate against the AD, and then switch identity to that user.

I see quite a few tutorials on how to authenticate against active directory, but don't see anything related to actual impersonation.

Basically I want something along those lines:

DirectoryEntry user = // authenticate against AD
// Switch current user identity 
// Do stuff
Evgeni
  • 3,341
  • 7
  • 37
  • 64

1 Answers1

1

Use WindowsIdentity.Impersonate with a user token generated by LogonUser

Best example here (read the full answer).

Community
  • 1
  • 1
Donal Lafferty
  • 5,807
  • 7
  • 43
  • 60