title: How can I assign a value to HttpContext.User in ASP.NET MVC?
body: <p>I write a controller like below:</p>
  
  <pre><code>public class AccountController : Controller
  {
      public ActionResult Login(/*---*/)
      {
          GenericIdentity identity = new GenericIdentity("userName");
          GenericPrincipal principal = new GenericPrincipal(identity, new string[] { "role1", "role2" });
          this.HttpContext.User = principal;
          /*---*/;
      }
  }
  </code></pre>
  
  <p>After login, I can get user name by User.Identity.Name in other controller.
  But User.IsInRole("role1") always return false.</p>
  
  <p>How can I assign a value to User, I don't want to use Membership...</p>