1

I can't get this stuff to work, I have read a bunch of books and tutorials but they all go down different paths. I'm looking for the simplest way to get a threaded principal working.

So far in my login controller

GenericIdentity myawesomeidentity = new GenericIdentity("tk421");
GenericPrincipal  myawesomeprincipal = new GenericPrincipal( myawesomeidentity, new string[] { "User" });
Thread.CurrentPrincipal = myawesomeprincipal;
return RedirectToAction("index", "home");

I don't have access to HttpContext.Current and after the redirect the thread has gone on a pub crawl somewhere.

What am I missing please?

sanepete
  • 979
  • 9
  • 28
  • I realise you're using threads, but an `async` approach might be a bit easier/less problematic. http://stackoverflow.com/questions/16552539/set-thread-currentprincipal-asynchronously – Rob Dec 04 '15 at 01:03
  • I don't understand the advantage of making the call asynchronously. – sanepete Dec 04 '15 at 10:55

0 Answers0