简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM