Saran
Saran

Reputation: 925

Impersonation Error

I am getting the below error in c# code after the impersonation.

{"Invalid token for impersonation - it cannot be duplicated."}

It is plain WPF windows application. In the begining of the application Impersonated the different user. Getting this error in random location.

Upvotes: 0

Views: 299

Answers (1)

Kiran Xyz
Kiran Xyz

Reputation: 63

I had similar issue and the solution is to have impersonation context at the actual task level rather than having all tasks performed under a single impersonation context. Earlier when I used impersonation context right from the button click event, I was performing all related tasks under the hood, but realized the impersonation context was failing between the tasks. So once I separated the context to have it exclusively for each of the tasks, everything worked fine! good luck.

Upvotes: 1

Related Questions