I have the code in application like
var principal = new GenericPrincipal(currentIdentity, roles);
Thread.CurrentPrincipal = principal;
but problem is when my application runs some threads are created automatically but there principle is not same as above one. How to set that?