title: Blazor WebApi Identity Information
body: <p>I am having trouble getting the users Identity information from within the API.
  My project consists of a standalone WASM app, IDP and WebApi.</p>
  <p>I have everything setup and it works but what I am after is a Call from the Blazor client to get some data from the api. The Api then uses the users email address to identify them and get the data just for them.</p>
  <p>I have looked at similar questions and the solutions don't work for me on my project.</p>
  <pre><code>[HttpGet(&quot;GetData&quot;)]
          public async Task&lt;IActionResult&gt; GetData()
          {
              string test = User.Identity.Name; // returns null
  
              string username = &quot;myuser@users.com&quot;;
  
              List&lt;string&gt; data= new List&lt;string&gt;();
              data= (await _dataRepository.GetData(username)).ToList();
  
              if (data.Count &gt; 0)
              {
                  return Ok(data);
              }
              else
              {
                  return NoContent();
              }
          }
  </code></pre>
  <p>So where I am setting the username is there a way to get a hold of the email of the user who passed the request?</p>
  <p><em>Edited</em>
  Access Token:</p>
  <pre><code>  {
    &quot;alg&quot;: &quot;RS256&quot;,
    &quot;kid&quot;: &quot;2D49329C75FC43C78590AF6F6A0EFDB2&quot;,
    &quot;typ&quot;: &quot;at+jwt&quot;
  }
  
  {
    &quot;nbf&quot;: 1639243158,
    &quot;exp&quot;: 1639246758,
    &quot;iss&quot;: &quot;https://localhost:5000&quot;,
    &quot;aud&quot;: &quot;https://localhost:5000/resources&quot;,
    &quot;client_id&quot;: &quot;ATS&quot;,
    &quot;sub&quot;: &quot;4892725f-f6da-4a28-827a-ce666bb6f098&quot;,
    &quot;auth_time&quot;: 1638729064,
    &quot;idp&quot;: &quot;local&quot;,
    &quot;jti&quot;: &quot;53CB2F8FCB2EB34E3501E2C210B59B5D&quot;,
    &quot;sid&quot;: &quot;8463E4AA74D7369C1176249ED8FA46B1&quot;,
    &quot;iat&quot;: 1639243158,
    &quot;scope&quot;: [
      &quot;openid&quot;,
      &quot;profile&quot;,
      &quot;MY_API&quot;
      &quot;email&quot;
    ],
    &quot;amr&quot;: [
      &quot;pwd&quot;
    ]
  }
  </code></pre>