title: How do I reference the HttpContext.Current.User after the Application_PostAuthenticateRequest in MVC?
body: <p>So here's a break down of my issue in steps:</p>
  
  <ol>
  <li>The user logs in with Google.</li>
  <li>On the login callback, information about the user is gathered</li>
  <li>Roles are assigned based on the user</li>
  <li>A FormsAuthenticationTicket is created which passes the user/roles to the Application_PostAuthenticateRequest in Global.asax</li>
  <li>In that request a GenericPrinciple is created from the authentication ticket and roles</li>
  <li>HttpContext.Current.User is set to the above variable</li>
  </ol>
  
  <p>Now my question is, now that I set who the current user is that is using the website, how can I reference them? After the post authenticate complete, I check the current user and it's null. Should I be setting the principle to a different variable other than HttpContext.Current.User?</p>
  
  <p>Callback</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; ExternalLoginCallback(string returnUrl)
  {
  ...
  // Get roles for current user
  string roles = "bob,adminbob,cthulu";
  
  FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
     1,
     loginInfo.Email,
     DateTime.Now,
     DateTime.Now.AddMinutes(30), // value of time out property
     false,
     roles,
     FormsAuthentication.FormsCookiePath);
  
  HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket));
  Response.Cookies.Add(authCookie);
  ...
  }
  </code></pre>
  
  <p>Post Authenticate in Global.asax</p>
  
  <pre><code>protected void Application_PostAuthenticateRequest(Object sender, EventArgs e) {
      HttpCookie authCookie = Context.Request.Cookies[FormsAuthentication.FormsCookieName];
  
     if (authCookie != null) {
        FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);
        string[] userRoles = authTicket.UserData.Split(new Char[] { ',' });
        GenericPrincipal userPrincipal = new GenericPrincipal(new GenericIdentity(authTicket.Name), userRoles);
        HttpContext.Current.User = userPrincipal; //How do I reference this in the program?
     }
  }
  </code></pre>