title: Adding claims to IdentityServer setup by AddIdentityServer
body: <p>I have a SPA that has an ASP.NET Core web API together with the inbuilt identity server switched on using <code>AddIdentityServer</code> and then <code>AddIdentityServerJwt</code>:</p>
  
  <pre><code>services.AddIdentityServer()
     .AddApiAuthorization&lt;User, UserDataContext&gt;();
  services.AddAuthentication()
     .AddIdentityServerJwt();
  </code></pre>
  
  <p>I also have an authorization policy setup that requires an "Admin" role claim:</p>
  
  <pre><code>services.AddAuthorization(options =&gt;
  {
      options.AddPolicy("IsAdmin", policy =&gt; policy.RequireClaim(ClaimTypes.Role, "Admin")); 
  });
  </code></pre>
  
  <p>I have a controller action that uses this policy</p>
  
  <pre><code>[Authorize(Policy = "IsAdmin")]
  [HttpDelete("{id}")]
  public IActionResult Deleten(int id)
  {
      ...
  }
  </code></pre>
  
  <p>The authenticated user does have the "Admin" role claim:</p>
  
  <p><a href="https://i.stack.imgur.com/lpsyc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lpsyc.png" alt="enter image description here"></a></p>
  
  <p>The access token for this authentication user doesn't appear to contain the admin claim:</p>
  
  <p><a href="https://i.stack.imgur.com/Ck91q.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Ck91q.png" alt="enter image description here"></a></p>
  
  <p>I get a 403 back when trying to request this resource with the admin user:</p>
  
  <p><a href="https://i.stack.imgur.com/4yNRo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4yNRo.png" alt="enter image description here"></a></p>
  
  <p>So, if I'm understanding this correctly, IdentityServer isn't including the admin role claim and so the user isn't authorized to access the resource.</p>
  
  <p>Is it possible to configure the claims that IdentityServer uses using <code>AddIdentityServerJwt</code>? or am I misunderstanding why this is not working.</p>