Maintaining Thread Identites

We were having some weird threading issues with database access. Turns out that the new threads were not acquiring the impersonated identity of the parent thread, but in fact the original identity. After quite a lot of digging using reflector, I checked the web for thoughts:

khanna suggests re-impersonating in the new thread, which is great, but in ASP.NET you don’t have an easy way to access the username and password. Ambrose pretty much nails the technique on the head, with Keith making a small but very required note at the end of his introduction to impersonation.

We now having threaded database access using the ASP.NET identity!

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>