title: Unable to use JWT for authentication in influxdb using C#
body: <p>I have tested that my token works via curl:</p>
  <pre><code>curl -XGET &quot;http://localhost:8086/query?db=test2&amp;q=show%20databases&quot; --header &quot;Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluMSIsImV4cCI6MTYzNDQyODgwMH0.1EzM01okZBuxDe_7V4VUvVUgyHkPiCCph1nysBLFpB0&quot;
  </code></pre>
  <p>Output:</p>
  <pre><code>{&quot;results&quot;:[{&quot;statement_id&quot;:0,&quot;series&quot;:[{&quot;name&quot;:&quot;databases&quot;,&quot;columns&quot;:[&quot;name&quot;],&quot;values&quot;:[[&quot;_internal&quot;],[&quot;test2&quot;]]}]}]}
  </code></pre>
  <p>But when I try to use the same token in my code I get:</p>
  <pre><code>InfluxDB.Client.Core.Exceptions.HttpException: '{&quot;error&quot;:&quot;unable to parse authentication credentials&quot;}
  </code></pre>
  <p>Here is the code:</p>
  <pre><code>var influxDBClient = InfluxDBClientFactory.Create(&quot;http://localhost:8086&quot;, &quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluMSIsImV4cCI6MTYzNDQyODgwMH0.1EzM01okZBuxDe_7V4VUvVUgyHkPiCCph1nysBLFpB0&quot;.ToCharArray());
  
                 var flux = &quot;from(bucket:\&quot;test2\&quot;) |&gt; range(start: 0)&quot;;
  
                  var fluxTables = await influxDBClient.GetQueryApi().QueryAsync(flux, &quot;org_id&quot;); // This is where I get the error
                  fluxTables.ForEach(fluxTable =&gt;
                  {
                      var fluxRecords = fluxTable.Records;
                      fluxRecords.ForEach(fluxRecord =&gt;
                      {
                          Console.WriteLine($&quot;{fluxRecord.GetTime()}: {fluxRecord.GetValue()}&quot;);
                      });
                  });
  
                  influxDBClient.Dispose();
  </code></pre>
  <p>I tried using it as a string (without converting it to a char array) and I got the same error. I tried adding <code>&quot;Authorization: Bearer &quot;</code> at the start of the token but the error persisted. When I use
  <code>var influxDBClient = InfluxDBClientFactory.Create(&quot;http://localhost:8086&quot;,  &quot;admin1&quot;, &quot;*snip*&quot;.ToCharArray());</code> it doesn't work either. Any help will be appreciated.</p>
  <p>P.S.: I'm on Windows, if that matters, and using Influxdb version 1.8.3-1.</p>