title: ASP.NET Core Access User.Identity in Controller Constructor
body: <p>I have a scenario where I need to access <code>User.Identity</code> Claims in my Constructor's Controller.</p>
  
  <p>I need this because the Claims have information required for me to spin up a custom DB Context (Connection String)</p>
  
  <p>How can I go about accessing this? I would just inject in the DBContext, but based on the user, they may need to access a different DB.</p>
  
  <p>Is there a better way to think about this?</p>
  
  <pre><code>[Authorize]
  public class DefaultController : Controller
  {
      public DefaultController()
      {
          // this is NULL
          var authenticatedUser = User.Identity.Name;
      }
  }
  </code></pre>