title: Jenkins REST API Auth using URL parameters
body: <p>I'm trying configure my Jenkins to allow remote job trigger using REST API. If I pass username and password using basic authentication header param, I'm able to trigger the job</p>
  
  <pre><code>-u &lt;username&gt;:&lt;api token&gt; http://localhost:8080/job/kp-push-example/build 
  </code></pre>
  
  <p>However if I pass username and api token in url, Jenkins is unable to authenticate, it uses anonymous user and throws error, as anonymous user does not have prevailage to execute the job.</p>
  
  <pre><code>http://&lt;username&gt;:&lt;apitoken&gt;@localhost:8080/job/kp-push-example/build 
  </code></pre>
  
  <p>Below is the error message.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv='refresh' content='1;url=/login?from=%2Fjob%2Fkp-push-example%2Fbuild'/&gt;
          &lt;script&gt;window.location.replace('/login?from=%2Fjob%2Fkp-push-example%2Fbuild');&lt;/script&gt;
      &lt;/head&gt;
      &lt;body style='background-color:white; color:white;'&gt;
  
  
  Authentication required
  
          &lt;!--
  You are authenticated as: anonymous
  Groups that you are in:
  
  Permission you need to have (but didn't): hudson.model.Hudson.Read
   ... which is implied by: hudson.security.Permission.GenericRead
   ... which is implied by: hudson.model.Hudson.Administer
  --&gt;
  
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How to configure Jenkins to allow url basic auth?
  Jenkins version: 2.129</p>