title: Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response(Jenkins API)
body: <p>I see below error when trying to access Jenkins API(<a href="https://jenkinsbox:3000/api/json" rel="nofollow noreferrer">https://jenkinsbox:3000/api/json</a>) using angular service with Basic authentication providing in headers.</p>
  
  <p>Error: </p>
  
  <blockquote>
    <p>Failed to load <a href="http://jenkinsbox:30000/api/json?&amp;tree=jobs[name]" rel="nofollow noreferrer">http://jenkinsbox:30000/api/json?&amp;tree=jobs[name]</a>:
    Request header field Authorization is not allowed by
    Access-Control-Allow-Headers in preflight response.</p>
  </blockquote>
  
  <pre><code>httpOptions = {
  headers: new HttpHeaders({
  'Content-Type':  'application/json',
  'Authorization': 'Basic ' + btoa('username:password')
  })
  
  getjobslists(): Observable&lt;jobs[]&gt;{
     this.url = "https://jenkinsbox:3000/api/json"
     console.log("getting data..")
     return this.http.get&lt;jobs[]&gt;(this.url + "/api/json?&amp;tree=jobs[name]",this.httpOptions)
  
      .pipe(map(function(res){
         //console.log(res);
         return res;
      }))
   }
  </code></pre>
  
  <p>And configured CORS in Jenkins using CORS Support plugin - 
  <a href="https://i.stack.imgur.com/yU9Oc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yU9Oc.png" alt="enter image description here"></a></p>
  
  <p>I think I'm missing something in "Access-Control-Allow-Headers" from Jenkins end. please assist</p>