title: Adding Authorization Header (Authorization: Bearer {access_token}) to specific route in Ocelot API Gateway
body: <p>I have a web application making requests to different APIs through an Ocelot API gateway. One of the endpoints require authentication via JWT sent as an Authorization header in the format &quot;Authorization: Bearer {access_token}&quot; (the &quot;Bearer&quot; keyword identifying it as a bearer/token authentication scheme). This token is specific for the app and is not used to authenticate with the gateway (which uses a different authentication scheme), rather it is stored as a claim in the application's secure HttpOnly cookie.</p>
  <p>While Ocelot does support transforming claims into headers (<a href="https://ocelot.readthedocs.io/en/latest/features/claimstransformation.html" rel="nofollow noreferrer">https://ocelot.readthedocs.io/en/latest/features/claimstransformation.html</a>),</p>
  <pre><code>&quot;AddHeadersToRequest&quot;: {
      &quot;HeaderName&quot;: &quot;Claims[ClaimName] &gt; value[0] &gt; |&quot;
  },
  </code></pre>
  <p>it only supports one value and no dynamic headers/string concatenation. In other words</p>
  <pre><code>&quot;AddHeadersToRequest&quot;: {
      &quot;Authorization&quot;: &quot;Bearer Claims[ClaimName] &gt; value[0] &gt; |&quot;
  },
  </code></pre>
  <p>would not work (such a request obviously results in error 401). So my question is, how do I add a proper authorization header/bearer token to a specific Ocelot route?</p>