Asp.net Core Authorize user with Policy
<p>I am trying to authorize an user with a bearer token send from the request header.
I added this code in startup file of resource server.</p>

<pre><code>services.AddAuthorization(auth =&gt;
{
   auth.AddPolicy("Bearer", new AuthorizationPolicyBuilder()                        
  .AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme)
  .RequireAuthenticatedUser().Build());
});
</code></pre>

<p>Here is my method in controller.</p>

<pre><code>[Authorize("Bearer")]
[HttpGet]
[Route("list")]
public IEnumerable&lt;Products&gt; List()
{
    string Authorization = Request.Headers["Authorization"];
}
</code></pre>

<p>Application showing me error 401 Unauthorized even if i had token</p>

<p>I am sending this Token in the header request</p>

<p>Authorization:Bearer "xyz"</p>