title: ClaimTypes.NameIdentifier returns always null in Blazor WebAssembly ASP.NET Core Hosted
body: <p>I have setup a <code>Blazor WebAssembly ASP.NET Core hosted</code>application and integrated the authentication system as well as the custom <code>AuthenticationProvider</code> to the client. In the server side project I am calling in the controller this:</p>
  <pre class="lang-cs prettyprint-override"><code>[HttpGet]
  public async Task&lt;ActionResult&gt; GetObjects()
  {
     var id = User.FindFirstValue(ClaimTypes.NameIdentifier); // &lt;-- returns always null
  }
  </code></pre>
  <p>and the <code>id</code> variable is always returning null.</p>
  <p>The user is from the aspnetcoreuser table (aspnetcore identity)
  In the table data I can see, as I am using SQLite, that the id is not null and ther users got added succesfully to the <code>aspnetuser</code> table.</p>
  <p>Some SDK-Versions:</p>
  <blockquote>
  <p>.NET Core SDKs installed:
  3.1.301 .NET Core runtimes installed:    Microsoft.AspNetCore.All 2.1.19 Microsoft.AspNetCore.App 2.1.19Microsoft.AspNetCore.App 3.1.5 Microsoft.NETCore.App 2.1.19 Microsoft.NETCore.App 3.1.5
  Microsoft.WindowsDesktop.App 3.1.5</p>
  </blockquote>
  <p>Also I have seen some solutions that the <code>&quot;windowsAuthentication&quot;: true, &quot;anonymousAuthentication&quot;: false,</code> from the <code>launchSettings.json</code> can cause that but with changes it does not solved it for me.</p>
  <p>Anyone here who can help me out?</p>