title: Asp .Net Core 5 Identity - How to fetch a user?
body: <p>In the new SPA (react and angular) web templates for .Net core 5. I'd like to fetch the current logged in User. However, when I try to get a user in the controller the User doesn't have anything populated.</p>
  <p>Does anyone know how to achieve this with the new Identity Classes?</p>
  <p>I've made a <a href="https://github.com/nicholasbergesen/timstemplate" rel="nofollow noreferrer">repo</a> of the vanilla reactJS template, the only thing I changed is the line highlighted in my screenshot below to show there's no user set.</p>
  <p>I've done a bit of googling and these pages are all I could find on the topic, unfortunately, they don't give enough detail for me to be able to implement anything practical.</p>
  <ul>
  <li><a href="https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-api-authorization?view=aspnetcore-5.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-api-authorization?view=aspnetcore-5.0</a></li>
  <li><a href="https://docs.microsoft.com/en-us/aspnet/core/security/authorization/claims?view=aspnetcore-5.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/security/authorization/claims?view=aspnetcore-5.0</a></li>
  </ul>
  <p><a href="https://i.stack.imgur.com/BPaXX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BPaXX.png" alt="enter image description here" /></a></p>